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!)
A239720 Primes of the form m = 10^i + 10^j - 1, where i > j >= 0. 7
109, 1009, 10009, 10099, 100999, 1000099, 1000999, 1000000009, 1000009999, 1000099999, 1009999999, 10000000999, 10000099999, 10999999999, 100999999999, 1000000009999, 1000000999999, 1099999999999, 10000000000099, 10009999999999 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
COMMENTS
Numbers with the first digit 1 followed by at least one 0-digit and ending with a number > 0 of trailing 9-digits.
The digital sum of a term 10^i + 10^j - 1 is = 1 + 9*j == 1 (mod 9).
Numbers m that satisfy m = 10^i + 10^j + 1 are never primes, since the digital sum of m is 3, and thus, m is divisible by 3.
LINKS
Harvey P. Dale, Table of n, a(n) for n = 1..1000 (* First 44 terms from Hieronymus Fischer *)
EXAMPLE
a(1) = 109, since 109 = 10^2 + 10^1 - 1 is prime.
a(2) = 1009, since 1009 = 10^3 + 10^1 - 1 is prime.
MATHEMATICA
Select[Flatten[Table[10^i+10^j-1, {i, 0, 20}, {j, 0, i-1}]], PrimeQ] (* Harvey P. Dale, Jan 30 2017 *)
PROG
(Smalltalk)
"Answer the n-th term of A239720.
Usage: n A239720
Answer: a(n)"
| a b i j k p q terms |
terms := OrderedCollection new.
k := 0.
b := 10.
p := b.
i := 1.
[k < self] whileTrue:
[j := 0.
q := 1.
[j < i and: [k < self]] whileTrue:
[a := p + q - 1.
a isPrime
ifTrue:
[k := k + 1.
terms add: a].
q := b * q.
j := j + 1].
i := i + 1.
p := b * p].
^terms at: self
--------------------
(Smalltalk)
"Version2: Answer an array of the first n terms of A239720.
Uses method primesWhichAreDistinctPowersOf: b withOffset: d from A239712.
Usage: n A239720
Answer: #(109 1009 ... ) [a(1) ... a(n)]"
^self primesWhichAreDistinctPowersOf: 10 withOffset: -1
CROSSREFS
Sequence in context: A178263 A061699 A359144 * A096214 A173665 A059936
KEYWORD
nonn
AUTHOR
Hieronymus Fischer, Apr 14 2014
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 12 11:28 EDT 2024. Contains 374245 sequences. (Running on oeis4.)