cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

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).

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Nov 08 2016

Keywords

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.

Examples

			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.
		

Crossrefs

Programs

  • 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))))))))

Formula

a(n) + A277891(n) = A260734(n).
For n >= 2, a(n) >= A277486(n).
a(n) >= A277488(n).