[go: up one dir, main page]

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!)
Search: a131377 -id:a131377
Displaying 1-2 of 2 results found. page 1
     Sort: relevance | references | number | modified | created      Format: long | short | data
A131807 Partial sums of A131377. +20
0
1, 2, 2, 3, 4, 4, 4, 5, 6, 7, 8, 8, 8, 9, 10, 11, 12, 12, 12, 13, 14, 15, 16, 16, 16, 16, 16, 16, 16, 17, 18, 18, 18, 18, 18, 18, 18, 19, 20, 21, 22, 22, 22, 23, 24, 25, 26, 26, 26, 26, 26, 26, 26, 27, 28, 29, 30, 31, 32, 32, 32, 33, 34, 35, 36, 37, 38, 38, 38, 38, 38, 39, 40, 40 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,2
LINKS
MAPLE
P:=proc(n) local i, k, s; k:=1; s:=0; for i from 0 by 1 to n do if isprime(i) then if k=1 then k:=0; else k:=1; fi; fi; s:=s+k; print(s); od; end: P(100);
PROG
(PARI) a(n) = sum(m=0, n, (primepi(m) % 2) == 0) \\ Michel Marcus, Aug 15 2023
CROSSREFS
Cf. A131377.
KEYWORD
easy,nonn
AUTHOR
STATUS
approved
A131378 Starting with 0, the sequence a(n) changes from 0 to 1 or back when the next number n is a prime. +10
3
0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,1
COMMENTS
Zero together with A071986. - Omar E. Pol, Feb 19 2011
Parity of A230980. - Omar E. Pol, Jul 19 2019
LINKS
EXAMPLE
n = 0, 1, 2, 3, 4, 5, etc.
a(n)= 0, 0, 1, 0, 0, 1, etc.
Starting with 0 the sequence changes when we move from 1 to 2 because 2 is prime, again from 2 to 3 because also 3 is prime, then from 4 to 5 being 5 prime and so on.
MAPLE
P:=proc(n) local i, k; k:=0; for i from 0 by 1 to n do if isprime(i) then if k=1 then k:=0; else k:=1; fi; fi; print(k); od; end: P(100);
MATHEMATICA
nxt[{n_, a_}]:={n+1, Which[a==0&&PrimeQ[n+1], 1, a==1&&PrimeQ[n+1], 0, True, a]}; NestList[nxt, {0, 0}, 100][[All, 2]] (* Harvey P. Dale, Jul 19 2019 *)
CROSSREFS
Cf. A131377.
Cf. A071986. - Omar E. Pol, Feb 19 2011
KEYWORD
easy,nonn
AUTHOR
STATUS
approved
page 1

Search completed in 0.007 seconds

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 August 30 07:09 EDT 2024. Contains 375532 sequences. (Running on oeis4.)