login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
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

%I #13 Nov 14 2016 10:36:32

%S 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,

%T 12,12,14,10,13,12,13,14,15,13,15,15,18,18,16,15,17,21,18,18,18,19,20,

%U 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

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

%C 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.

%C a(n) = number of even numbers on row n of A276574, after the initial zero-row.

%C See also comments in A277891.

%H Antti Karttunen, <a href="/A277890/b277890.txt">Table of n, a(n) for n = 1..10000</a>

%F a(n) + A277891(n) = A260734(n).

%F For n >= 2, a(n) >= A277486(n).

%F a(n) >= A277488(n).

%e 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.

%o (PARI)

%o 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

%o isthree(n:int)=my(tmp=valuation(n, 2)); bitand(tmp, 1)||bitand(n>>tmp, 7)!=7

%o A002828(n)=if(issquare(n), !!n, if(istwo(n), 2, 4-isthree(n))) \\ From _Charles R Greathouse_ IV, Jul 19 2011

%o 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; };

%o for(n=1, 10000, write("b277890.txt", n, " ", A277890(n)));

%o (Scheme)

%o (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))))))))

%Y Cf. A000035, A000290, A002828, A010052, A260734, A276573, A276574, A277486, A277488, A277889, A277891.

%K nonn

%O 1,2

%A _Antti Karttunen_, Nov 08 2016

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified July 10 05:05 EDT 2024. Contains 374194 sequences. (Running on oeis4.)