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.

Showing 1-7 of 7 results.

A092621 Primes with exactly one prime digit.

Original entry on oeis.org

2, 3, 5, 7, 13, 17, 29, 31, 43, 47, 59, 67, 71, 79, 83, 97, 103, 107, 113, 131, 139, 151, 163, 167, 179, 193, 197, 211, 241, 269, 281, 311, 349, 389, 421, 431, 439, 443, 463, 467, 479, 487, 509, 541, 569, 599, 607, 613, 617, 631, 643, 647, 659, 683, 701, 709
Offset: 1

Views

Author

Jani Melik, Apr 11 2004

Keywords

Examples

			13 is prime and it has one prime digit, 3;
103 is prime and it has one prime digit, 3.
		

Crossrefs

Cf. A239037 (prime digit in A092621(n)). - Zak Seidov, Mar 10 2014

Programs

  • Maple
    stev_sez:=proc(n) local i, tren, st, ans, anstren; ans:=[ ]: anstren:=[ ]: tren:=n: for i while (tren>0) do st:=round( 10*frac(tren/10) ): ans:=[ op(ans), st ]: tren:=trunc(tren/10): end do; for i from nops(ans) to 1 by -1 do anstren:=[ op(anstren), op(i,ans) ]; od; RETURN(anstren); end: ts_stpf:=proc(n) local i, stpf, ans; ans:=stev_sez(n): stpf:=0: for i from 1 to nops(ans) do if (isprime(op(i,ans))='true') then stpf:=stpf+1; # number of prime digits fi od; RETURN(stpf) end: ts_pr_prn:=proc(n) local i, stpf, ans, ans1, tren; ans:=[ ]: stpf:=0: tren:=1: for i from 1 to n do if ( isprime(i)='true' and ts_stpf(i) = 1) then ans:=[ op(ans), i ]: tren:=tren+1; fi od; RETURN(ans) end: ts_pr_prn(1000);
  • Mathematica
    podQ[n_]:=(1==Length@Select[IntegerDigits[n],PrimeQ]);Select[Prime[Range[250]],podQ](* Zak Seidov *)
  • PARI
    isok(n) = isprime(n) && (d = digits(n)) && (sum(i=1, #d, isprime(d[i])) == 1); \\ Michel Marcus, Mar 10 2014
  • Sage
    A092621 = list(p for p in primes(1000) if len([d for d in p.digits() if is_prime(d)]) == 1)
    

Formula

a(n) >> n^1.28 because of the digit restriction

A193238 Number of prime digits in decimal representation of n.

Original entry on oeis.org

0, 0, 1, 1, 0, 1, 0, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 1, 0, 0, 1, 1, 2, 2, 1, 2, 1, 2, 1, 1, 1, 1, 2, 2, 1, 2, 1, 2, 1, 1, 0, 0, 1, 1, 0, 1, 0, 1, 0, 0, 1, 1, 2, 2, 1, 2, 1, 2, 1, 1, 0, 0, 1, 1, 0, 1, 0, 1, 0, 0, 1, 1, 2, 2, 1, 2, 1, 2, 1, 1, 0, 0, 1, 1, 0, 1
Offset: 0

Views

Author

Reinhard Zumkeller, Jul 19 2011

Keywords

Crossrefs

Programs

Formula

a(A084984(n))=0; a(A118950(n))>0; a(A092620(n))=1; a(A092624(n))=2; a(A092625(n))=3; a(A046034(n))=A055642(A046034(n));
a(A000040(n)) = A109066(n).
From Hieronymus Fischer, May 30 2012: (Start)
a(n) = sum_{j=1..m+1} (floor(n/10^j+0.3) + floor(n/10^j+0.5) + floor(n/10^j+0.8) - floor(n/10^j+0.2) - floor(n/10^j+0.4) - floor(n/10^j+0.6)), where m=floor(log_10(n)), n>0.
a(10n+k) = a(n) + a(k), 0<=k<10, n>=0.
a(n) = a(floor(n/10)) + a(n mod 10), n>=0.
a(n) = sum_{j=0..m} a(floor(n/10^j) mod 10), n>=0.
a(A046034(n)) = floor(log_4(3n+1)), n>0.
a(A211681(n)) = 1 + floor((n-1)/4), n>0.
G.f.: g(x) = (1/(1-x))*sum_{j>=0} (x^(2*10^j) + x^(3*10^j)+ x^(5*10^j) + x^(7*10^j))*(1-x^10^j)/(1-x^10^(j+1)).
Also: g(x) = (1/(1-x))*sum_{j>=0} (x^(2*10^j)- x^(4*10^j)+ x^(5*10^j)- x^(6*10^j)+ x^(7*10^j)- x^(8*10^j))/(1-x^10^(j+1)). (End)

A118950 Numbers containing at least one prime digit.

Original entry on oeis.org

2, 3, 5, 7, 12, 13, 15, 17, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 42, 43, 45, 47, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 62, 63, 65, 67, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 82, 83, 85, 87, 92, 93, 95, 97, 102, 103, 105, 107, 112
Offset: 1

Views

Author

Rick L. Shepherd, May 06 2006

Keywords

Comments

A193238(a(n)) > 0; complement of A084984; A092620, A092624 and A092625 are subsequences. - Reinhard Zumkeller, Jul 19 2011

Crossrefs

Programs

  • Haskell
    a118950 n = a118950_list !! (n-1)
    a118950_list = filter (any (`elem` "2357") . show ) [0..]
    -- Reinhard Zumkeller, Jul 19 2011
    
  • Mathematica
    Select[Range[150],AnyTrue[IntegerDigits[#],PrimeQ]&] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Jul 19 2018 *)
  • PARI
    is(n)=!!#select(isprime, digits(n)) \\ Charles R Greathouse IV, Sep 15 2015

Formula

a(n) = n + O(n^k) with k = log 6/log 10 = 0.77815.... - Charles R Greathouse IV, Sep 15 2015

A092624 Numbers with exactly two prime digits.

Original entry on oeis.org

22, 23, 25, 27, 32, 33, 35, 37, 52, 53, 55, 57, 72, 73, 75, 77, 122, 123, 125, 127, 132, 133, 135, 137, 152, 153, 155, 157, 172, 173, 175, 177, 202, 203, 205, 207, 212, 213, 215, 217, 220, 221, 224, 226, 228, 229, 230, 231, 234, 236, 238, 239, 242, 243, 245
Offset: 1

Views

Author

Jani Melik, Apr 11 2004

Keywords

Comments

A193238(a(n))=2; subsequence of A118950. [Reinhard Zumkeller, Jul 19 2011]

Examples

			25 has two prime digits, 2 and 5;
207 has two prime digits, 2 and 7.
		

Crossrefs

Programs

  • Haskell
    import Data.List (elemIndices)
    a092624 n = a092624_list !! (n-1)
    a092624_list = elemIndices 2 a193238_list
    -- Reinhard Zumkeller, Jul 19 2011
  • Maple
    stev_sez:=proc(n) local i, tren, st, ans, anstren; ans:=[ ]: anstren:=[ ]: tren:=n: for i while (tren>0) do st:=round( 10*frac(tren/10) ): ans:=[ op(ans), st ]: tren:=trunc(tren/10): end do; for i from nops(ans) to 1 by -1 do anstren:=[ op(anstren), op(i,ans) ]; od; RETURN(anstren); end: ts_stpf:=proc(n) local i, stpf, ans; ans:=stev_sez(n): stpf:=0: for i from 1 to nops(ans) do if (isprime(op(i,ans))='true') then stpf:=stpf+1; # number of prime digits fi od; RETURN(stpf) end: ts_pr_nd:=proc(n) local i, stpf, ans, ans1, tren; ans:=[ ]: stpf:=0: tren:=1: for i from 1 to n do if ( ts_stpf(i) = 2) then ans:=[ op(ans), i ]: tren:=tren+1; fi od; RETURN(ans) end: ts_pr_nd(500);
  • Mathematica
    Select[Range[300],Count[IntegerDigits[#],?PrimeQ]==2&] (* _Harvey P. Dale, Apr 20 2025 *)

A092625 Numbers with exactly three prime digits.

Original entry on oeis.org

222, 223, 225, 227, 232, 233, 235, 237, 252, 253, 255, 257, 272, 273, 275, 277, 322, 323, 325, 327, 332, 333, 335, 337, 352, 353, 355, 357, 372, 373, 375, 377, 522, 523, 525, 527, 532, 533, 535, 537, 552, 553, 555, 557, 572, 573, 575, 577, 722, 723, 725
Offset: 1

Views

Author

Jani Melik, Apr 11 2004

Keywords

Comments

It is the same as A046034 from two digit numbers from 22 up to four digit numbers from 1222.
A193238(a(n))=3; subsequence of A118950. [Reinhard Zumkeller, Jul 19 2011]

Examples

			222 has three prime digits, three times 2;
1235 has three prime digits, 2, 3 and 5.
		

Crossrefs

Programs

  • Haskell
    import Data.List (elemIndices)
    a092625 n = a092625_list !! (n-1)
    a092625_list = elemIndices 3 a193238_list
    -- Reinhard Zumkeller, Jul 19 2011
  • Maple
    stev_sez:=proc(n) local i, tren, st, ans, anstren; ans:=[ ]: anstren:=[ ]: tren:=n: for i while (tren>0) do st:=round( 10*frac(tren/10) ): ans:=[ op(ans), st ]: tren:=trunc(tren/10): end do; for i from nops(ans) to 1 by -1 do anstren:=[ op(anstren), op(i,ans) ]; od; RETURN(anstren); end: ts_stpf:=proc(n) local i, stpf, ans; ans:=stev_sez(n): stpf:=0: for i from 1 to nops(ans) do if (isprime(op(i,ans))='true') then stpf:=stpf+1; # number of prime digits fi od; RETURN(stpf) end: ts_pr_nt:=proc(n) local i, stpf, ans, ans1, tren; ans:=[ ]: stpf:=0: tren:=1: for i from 1 to n do if ( ts_stpf(i) = 3) then ans:=[ op(ans), i ]: tren:=tren+1; fi od; RETURN(ans) end: ts_pr_nt(2000);
  • Mathematica
    Select[Range[800],Total[Boole[PrimeQ[IntegerDigits[#]]]]==3&] (* Harvey P. Dale, Dec 31 2023 *)

A260181 Numbers whose last digit is prime.

Original entry on oeis.org

2, 3, 5, 7, 12, 13, 15, 17, 22, 23, 25, 27, 32, 33, 35, 37, 42, 43, 45, 47, 52, 53, 55, 57, 62, 63, 65, 67, 72, 73, 75, 77, 82, 83, 85, 87, 92, 93, 95, 97, 102, 103, 105, 107, 112, 113, 115, 117, 122, 123, 125, 127, 132, 133, 135, 137, 142, 143, 145, 147
Offset: 1

Views

Author

Wesley Ivan Hurt, Jul 17 2015

Keywords

Comments

Numbers ending in 2, 3, 5 or 7.
The subsequence of primes is A042993. - Michel Marcus, Jul 19 2015
From Wesley Ivan Hurt, Aug 15 2015, Sep 26 2015: (Start)
Ceiling(a(n)/2) = A047201(n).
Complement of (A197652 Union A262389). (End)

Crossrefs

Cf. A042993, A047201, A092620, subset of A118950.
Union of A017293, A017305, A017329 and A017353.
First differences are [1,2,2,5,...] = A002522(A140081(n-1)).

Programs

  • GAP
    a:=n->(5*n-4-(-1)^n+((3-(-1)^n)/2)*(-1)^((2*n+5-(-1)^n)/4))/2; List([1..60],n->a(n)); # Muniru A Asiru, Feb 16 2018
  • Magma
    [(5*n-4-(-1)^n+((3-(-1)^n) div 2)*(-1)^((2*n+5-(-1)^n) div 4))/2: n in [1..70]]; // Vincenzo Librandi, Jul 18 2015
    
  • Maple
    A260181:=n->(5*n-4-(-1)^n+((3-(-1)^n)/2)*(-1)^((2*n+5-(-1)^n)/4))/2: seq(A260181(n), n=1..100);
  • Mathematica
    CoefficientList[Series[(2 + x + 2 x^2 + 2 x^3 + 3 x^4)/((x - 1)^2*(1 + x + x^2 + x^3)), {x, 0, 100}], x]
    LinearRecurrence[{1, 0, 0, 1, -1}, {2, 3, 5, 7, 12}, 60] (* Vincenzo Librandi, Jul 18 2015 *)
    Table[(5n - 4 - (-1)^n + ((3 - (-1)^n)/2)*(-1)^((2*n + 5 - (-1)^n)/4))/2, {n, 100}] (* Wesley Ivan Hurt, Aug 11 2015 *)
  • PARI
    is(n)=my(m=digits(n));isprime(m[#m]) \\ Anders Hellström, Jul 19 2015
    
  • PARI
    A260181(n)=(n--)\4*10+prime(n%4+1) \\ is(n)=isprime(n%10) is much more efficient than the above. - M. F. Hasler, Sep 16 2016
    

Formula

G.f.: x*(2+x+2*x^2+2*x^3+3*x^4) / ((x-1)^2*(1+x+x^2+x^3)).
a(n) = a(n-1)+a(n-4)-a(n-5), n>5.
a(n) = (5*n-4-(-1)^n+((3-(-1)^n)/2)*(-1)^((2*n+5-(-1)^n)/4))/2.
Sum_{n>=1} (-1)^(n+1)/a(n) = (2*sqrt(5*sqrt(5+2*sqrt(5))) - 25*log(5) - 40*log(2) + 5*sqrt(5)*arccoth(843/2))/200. - Amiram Eldar, Jul 30 2024

A155989 List of numbers prime(k) as k runs through the numbers with a single prime digit.

Original entry on oeis.org

3, 5, 11, 17, 37, 41, 47, 59, 71, 73, 89, 101, 107, 109, 113, 127, 139, 151, 163, 167, 181, 191, 197, 211, 229, 233, 251, 263, 271, 277, 293, 307, 313, 331, 349, 353, 373, 383, 397, 401, 421, 431, 439, 449, 479, 487, 499, 509, 557, 563, 571, 587, 613, 617, 631
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Feb 01 2009

Keywords

Crossrefs

Programs

  • Maple
    numPdgs := proc(n) local f,d ; f := 0 ; for d in convert(n,base,10) do if d in {2,3,5,7} then f :=f+1; end if; end do; f ; end proc:
    A092620 := proc(n) option remember; if n = 1 then 2; else for a from procname(n-1)+1 do if numPdgs(a) = 1 then return a; end if; end do: end if; end proc:
    A155989 := proc(n) ithprime(A092620(n)) ; end proc: seq(A155989(n),n=1..120) ; # R. J. Mathar, May 15 2010
  • Mathematica
    Prime[#]&/@Select[Range[150],Count[IntegerDigits[#],?PrimeQ]==1&] (* _Harvey P. Dale, Feb 26 2013 *)

Formula

a(n) = A000040(A092620(n)). - R. J. Mathar, May 15 2010

Extensions

Edited by N. J. A. Sloane, Feb 02 2009
Showing 1-7 of 7 results.