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!)
A103270 a(n) = (prime(n)+prime(n+k)) mod 4, where k = (prime(n+1)-prime(n))/2. 3
0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 2, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 2, 0, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 2, 0, 0, 0, 0, 0, 2, 0, 2, 2, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 (list; graph; refs; listen; history; text; internal format)
OFFSET
2,10
COMMENTS
If {prime(n), prime(n+1)} are twin primes, then a(n) = 2*prime(n)+2 = 0 mod 4.
The number of 2's up to n = 2^k, k >= 1, is (0, 0, 0, 1, 4, 9, 30, 72, 162, 346, 779, 1596, 3333, 6867, 13987, 28229,...). Between n = 2^5 and n = 2^16, the percentage of 2's increases from 12.5% to 43%. - M. F. Hasler, Jun 06 2017
LINKS
MAPLE
a:=proc(n) local k: k:=(ithprime(n+1)-ithprime(n))/2: ithprime(n)+ithprime(n+k) mod 4 end: seq(a(n), n=2..130); # Emeric Deutsch, May 31 2005
MATHEMATICA
Table[Mod[Prime[n]+Prime[n+(Prime[n+1]-Prime[n])/2], 4], {n, 2, 120}] (* Harvey P. Dale, Jun 30 2020 *)
PROG
(PARI) a(n)=(prime(n+(prime(n+1)-n=prime(n))/2)+n)%4 \\ M. F. Hasler, May 12 2016
(PARI) {S=0; L=n=1; o=3; forprime(p=4, , S+=(o+prime((-o+o=p)\2+n++))%4; n<L||print1(S", ")||L*=2)} \\ Slightly optimized to compute partial sums up to n = 2^k. - M. F. Hasler, Jun 06 2017
CROSSREFS
Cf. A103271.
See A287868 for positions of 2's.
Sequence in context: A218218 A332006 A086016 * A087780 A082523 A186034
KEYWORD
nonn
AUTHOR
Yasutoshi Kohmoto, Jan 27 2005
EXTENSIONS
More terms from Emeric Deutsch, May 31 2005
STATUS
approved

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 26 17:53 EDT 2024. Contains 374636 sequences. (Running on oeis4.)