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!)
A343676 Number of n-digit undulating alternating primes. 1
4, 9, 23, 49, 175, 321, 1189, 3025, 12111, 28492, 113409, 251513, 1068440, 2629980, 11690210, 28498852, 128871588, 298890814, 1309837146 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
COMMENTS
a(n) is the number of n-digit terms in A343590.
a(n) <= A057333(n).
LINKS
PROG
(Python)
def f(w):
for s in w:
for t in range(int(s[-1])+1, 10, 2):
yield s+str(t)
def g(w):
for s in w:
for t in range(1-int(s[-1])%2, int(s[-1]), 2):
yield s+str(t)
def A343676(n):
c = 0
for d in '123456789':
x = d
for i in range(1, n):
x = g(x) if i % 2 else f(x)
c += sum(1 for p in x if isprime(int(p)))
if n > 1:
y = d
for i in range(1, n):
y = f(y) if i % 2 else g(y)
c += sum(1 for p in y if isprime(int(p)))
return c
CROSSREFS
Sequence in context: A361002 A138990 A014543 * A131607 A221313 A238832
KEYWORD
nonn,base,more
AUTHOR
Chai Wah Wu, Apr 25 2021
EXTENSIONS
a(18)-a(19) from Martin Ehrenstein, Apr 27 2021
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 August 4 01:40 EDT 2024. Contains 374905 sequences. (Running on oeis4.)