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!)
A120804 Primes with consecutive digits descending. 5

%I

%S 2,3,5,7,43,109,10987,76543,10987654321098765432109876543210987,

%T 4321098765432109876543210987654321098765432109876543210987654321

%N Primes with consecutive digits descending.

%C Digits can be in descending order. After 0 comes 9.

%C a(15) has 1053 digits. - _Michael S. Branicky_, Aug 05 2022

%H Paul Tek, <a href="/A120804/b120804.txt">Table of n, a(n) for n = 1..14</a>

%t f[n_] := Block[{d = Reverse@ Range@n, t = Table[1, {n}]}, Select[ Drop[ Union@ Flatten@ Table[ FromDigits[ Mod[d + i*t, 10]], {i, 10}], 2], PrimeQ@# &]]; Array[f, 1000] // Flatten

%o (Python)

%o from sympy import isprime

%o from itertools import count, islice

%o def bgen(): yield from (int("".join(str((s0-i)%10) for i in range(d))) for d in count(1) for s0 in range(1, 10))

%o def agen(): yield from filter(isprime, bgen())

%o print(list(islice(agen(), 10))) # _Michael S. Branicky_, Aug 05 2022

%Y Cf. A006055, A120805.

%K nonn,base

%O 1,1

%A _Robert G. Wilson v_, Jul 05 2006

%E Corrected by _Paul Tek_, May 08 2013

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 January 27 09:55 EST 2023. Contains 359838 sequences. (Running on oeis4.)