login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A277890
Number of even numbers encountered before (n^2)-1 is reached when starting from k = ((n+1)^2)-1 and iterating map k -> k - A002828(k).
7
0, 2, 0, 3, 2, 3, 1, 5, 3, 4, 4, 6, 3, 5, 3, 7, 8, 8, 6, 8, 9, 10, 6, 8, 10, 10, 7, 11, 10, 13, 11, 12, 12, 14, 10, 13, 12, 13, 14, 15, 13, 15, 15, 18, 18, 16, 15, 17, 21, 18, 18, 18, 19, 20, 16, 21, 20, 20, 22, 20, 23, 20, 22, 23, 21, 23, 23, 27, 25, 24, 22, 28, 22, 27, 24, 26, 25, 25, 29, 29, 28, 26, 30, 31, 28, 28, 31, 30, 32, 33, 27, 32, 34, 34, 30, 33, 33
OFFSET
1,2
COMMENTS
The starting point ((n+1)^2)-1 of the iteration is included if it is even, but the ending point (n^2)-1 is never included in the count.
a(n) = number of even numbers on row n of A276574, after the initial zero-row.
See also comments in A277891.
LINKS
FORMULA
a(n) + A277891(n) = A260734(n).
For n >= 2, a(n) >= A277486(n).
a(n) >= A277488(n).
EXAMPLE
For n=6, we start iterating from k = ((6+1)^2)-1 = 48, and then 48 - A002828(48) = 45, 45 - A002828(45) = 43, 43 - A002828(43) = 40, 40 - A002828(40) = 38, and 38 - A002828(38) = 35 (which is 6^2 - 1), and three of these numbers are even, thus a(6) = 3.
PROG
(PARI)
istwo(n:int)=my(f); if(n<3, return(n>=0); ); f=factor(n>>valuation(n, 2)); for(i=1, #f[, 1], if(bitand(f[i, 2], 1)==1&&bitand(f[i, 1], 3)==3, return(0))); 1
isthree(n:int)=my(tmp=valuation(n, 2)); bitand(tmp, 1)||bitand(n>>tmp, 7)!=7
A002828(n)=if(issquare(n), !!n, if(istwo(n), 2, 4-isthree(n))) \\ From _Charles R Greathouse_ IV, Jul 19 2011
A277890(n) = { my(orgk = ((n+1)^2)-1); my(k = orgk, s = 0); while(((k == orgk) || !issquare(1+k)), s = s + (1-(k%2)); k = k - A002828(k)); s; };
for(n=1, 10000, write("b277890.txt", n, " ", A277890(n)));
(Scheme)
(define (A277890 n) (let ((org_k (- (A000290 (+ 1 n)) 1))) (let loop ((k org_k) (s 0)) (if (and (< k org_k) (= 1 (A010052 (+ 1 k)))) s (loop (- k (A002828 k)) (+ s (- 1 (A000035 k))))))))
KEYWORD
nonn
AUTHOR
Antti Karttunen, Nov 08 2016
STATUS
approved