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.

A162886 Even numbers in an alternating 1-based sum up to some odd nonprime.

This page as a plain text file.
%I A162886 #8 Mar 02 2019 23:19:18
%S A162886 24,42,54,60,78,84,96,114,132,138,144,150,168,174,180,186,204,216,222,
%T A162886 234,240,258,264,276,282,294,306,312,324,330,348,354,366,372,384,390,
%U A162886 402,414,420,432,438,444,450,456,474,480,486,492,504,510,516,528,534,546,558,564
%N A162886 Even numbers in an alternating 1-based sum up to some odd nonprime.
%C A162886 Define an alternating sum S(n) = Sum_{k=0..n} (1-(-1)^k*k) = A064455(n+1).
%C A162886 The sequence contains this sum evaluated for an upper limit of the odd nonprimes where the sum is even.
%e A162886 S(n) evaluated at n=1, 9, 15, 21, ... (taken from A014076) is 3, 15, 24, 33, 42, 51, etc., where only the even values (i.e., 24, 42, etc.) join the sequence.
%p A162886 A014076 := proc(n) option remember ; if n = 1 then 1; else for a from procname(n-1)+2 by 2 do if not isprime(a) then RETURN(a) ; fi; od: fi; end:
%p A162886 S := proc(n) A064455(A014076(n)+1) ; end:
%p A162886 for n from 1 to 200 do if S(n) mod 2 = 0 then printf("%d,",S(n)) ; fi; od: # _R. J. Mathar_, Jul 21 2009
%Y A162886 Cf. A014076.
%K A162886 nonn,less
%O A162886 1,1
%A A162886 _Juri-Stepan Gerasimov_, Jul 16 2009
%E A162886 Edited and values checked by _R. J. Mathar_ Jul 21 2009