login
This site is supported by donations to The OEIS Foundation.
Logo

Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A078652 a(1)=1, a(2n)=nextprime(a(n-1)), a(2n+1)= sum of digits of all previous terms + 1. 0
1, 2, 4, 5, 13, 17, 25, 29, 43, 47, 61, 67, 81, 83, 101, 103, 107, 109, 125, 127, 143, 149, 165, 167, 191, 193, 215, 223, 230, 233, 243, 251, 260, 263, 279, 281, 308, 311, 324, 331, 340, 347, 361, 367, 387, 389, 425, 431, 444, 449, 473, 479, 507, 509, 533, 541 (list; graph; refs; listen; history; internal format)
OFFSET

1,2

MATHEMATICA

lst={1}; i=1; Do[If[EvenQ[n], AppendTo[lst, NextPrime[Last[lst]]], AppendTo[ lst, Total[ Flatten[ IntegerDigits/@ lst]]]]; i++, {n, 60}]; Rest[lst] (* From Harvey P. Dale, Sep 03 2011 *)

PROG

(PARI) digitsum(n) = local(s, d); s=0; while(n>0, d=divrem(n, 10); n=d[1]; s=s+d[2]); s {sdnp(m)=local(a=1, ct=0, lp=0, ls=0, sqc=0, sr=0, t=1); for(n=1, m, if(n%2==0, b=nextprime(a+1); t+=digitsum(b); a=b; ct++; print1(b, " "); if(issquare(b), sqc++; ls=b; ); sr+=(1.0/b), b=t; t+=digitsum(b); a=b; print1(b, " "); if(isprime(b), ct++; lp=b; ); if(issquare(b), sqc++; ls=b; ); sr+=(1.0/b); )); print(); print(Results); print("Found "ct" primes <= "m); print("Found "sqc" squares <= "m); print("Last prime found in odd part: "lp); print("Last square found: "ls); print("Ratio of primes to "m" is "ct/m+0.0); print("Sum of reciprocals = "sr); }

CROSSREFS

Sequence in context: A128457 A139485 A079407 * A102992 A136563 A127077

Adjacent sequences:  A078649 A078650 A078651 * A078653 A078654 A078655

KEYWORD

base,easy,nonn

AUTHOR

Jason Earls (zevi_35711(AT)yahoo.com), Dec 14 2002

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Transforms | Puzzles | Hot | Classics
Recent Additions | More pages | Superseeker | Maintained by The OEIS Foundation Inc.

Content is available under The OEIS End-User License Agreement .

Last modified February 16 04:47 EST 2012. Contains 205860 sequences.