cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A239720 Primes of the form m = 10^i + 10^j - 1, where i > j >= 0.

This page as a plain text file.
%I A239720 #20 Jul 30 2025 09:45:58
%S A239720 109,1009,10009,10099,100999,1000099,1000999,1000000009,1000009999,
%T A239720 1000099999,1009999999,10000000999,10000099999,10999999999,
%U A239720 100999999999,1000000009999,1000000999999,1099999999999,10000000000099,10009999999999
%N A239720 Primes of the form m = 10^i + 10^j - 1, where i > j >= 0.
%C A239720 Numbers with the first digit 1 followed by at least one 0-digit and ending with a number > 0 of trailing 9-digits.
%C A239720 The digital sum of a term 10^i + 10^j - 1 is = 1 + 9*j == 1 (mod 9).
%C A239720 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.
%H A239720 Harvey P. Dale, <a href="/A239720/b239720.txt">Table of n, a(n) for n = 1..1000</a> (First 44 terms from Hieronymus Fischer)
%e A239720 a(1) = 109, since 109 = 10^2 + 10^1 - 1 is prime.
%e A239720 a(2) = 1009, since 1009 = 10^3 + 10^1 - 1 is prime.
%t A239720 Select[Flatten[Table[10^i+10^j-1,{i,0,20},{j,0,i-1}]],PrimeQ] (* _Harvey P. Dale_, Jan 30 2017 *)
%o A239720 (Smalltalk)
%o A239720 A239720
%o A239720   "Answer the n-th term of A239720.
%o A239720   Usage: n A239720
%o A239720   Answer: a(n)"
%o A239720   | a b i j k p q terms |
%o A239720   terms := OrderedCollection new.
%o A239720   k := 0.
%o A239720   b := 10.
%o A239720   p := b.
%o A239720   i := 1.
%o A239720   [k < self] whileTrue:
%o A239720          [j := 0.
%o A239720          q := 1.
%o A239720          [j < i and: [k < self]] whileTrue:
%o A239720                    [a := p + q - 1.
%o A239720                    a isPrime
%o A239720                         ifTrue:
%o A239720                             [k := k + 1.
%o A239720                             terms add: a].
%o A239720                    q := b * q.
%o A239720                    j := j + 1].
%o A239720          i := i + 1.
%o A239720          p := b * p].
%o A239720   ^terms at: self
%o A239720 --------------------
%o A239720 (Smalltalk)
%o A239720 A239720
%o A239720   "Version2: Answer an array of the first n terms of A239720.
%o A239720   Uses method primesWhichAreDistinctPowersOf: b withOffset: d from A239712.
%o A239720   Usage: n A239720
%o A239720   Answer: #(109 1009 ... ) [a(1) ... a(n)]"
%o A239720   ^self primesWhichAreDistinctPowersOf: 10 withOffset: -1
%K A239720 nonn
%O A239720 1,1
%A A239720 _Hieronymus Fischer_, Apr 14 2014