web site troubles
N. J. A. Sloane
njas at research.att.com
Tue Aug 26 22:15:39 CEST 2008
A141619 Problem of the week at school.
3, 2, 6, 3, 9, 5, 12, 7
AUTHOR Marina (kiev.marina(AT)gmail.com), Aug 23 2008
-----------------------------------------------------------------------------------
The definition below (if you change index from 0 to 1) *fits* given 8
terms but probably your teacher meant something much simpler ;-)
a(1)=3;
for n>1
if n is even, then a(n) = prime(n/2)
else /* n is odd */ a(n) = 3 + a(n-2)
PARI could implement above as
j=[]; j=concat(j,3); for(n=2, 30, if((floor(n/2))==(ceil(n/2)),
j=concat(j,(prime(n/2))), j=concat(j,3+(j[n-2])))); j
[3, 2, 6, 3, 9, 5, 12, 7, 15, 11, 18, 13, 21, 17, 24, 19, 27, 23,
30, 29, 33, 31, 36, 37, 39, 41, 42, 43, 45, 47]
Best, AP
More information about the SeqFan
mailing list