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-2 of 2 results.

A331898 The smallest prime number with exactly n circular loops in its decimal representation.

Original entry on oeis.org

2, 19, 83, 89, 809, 1889, 8089, 48889, 88883, 828889, 688889, 3888889, 8868889, 28888889, 88888883, 288888889, 808888889, 6886888889, 8688888889, 48888888889, 188688888889, 288888888889, 888088888889, 1888888888889, 8888988888889, 58888888888889, 188880888888889
Offset: 0

Views

Author

Sara Mutter, Jan 31 2020

Keywords

Comments

Least prime p such that A064532(p) = n.
The digit 8 has two loops and the digits 0, 6 and 9 have one loop.

Examples

			a(3) = 89 because 8 has two loops and 9 has one loop for a total of 3.
		

Crossrefs

Programs

  • Mathematica
    Block[{s = Range[0, 15]}, Sort[#][[All, -1]] &@ Reap[Do[If[! FreeQ[s, #2], Sow[{#2, #1}]; s = DeleteCases[s, #2]] & @@ {#, Total[{0, 0, 0, 0, 0, 1, 0, 2, 1, 1} DigitCount[#]]} &@ Prime@ i, {i, 3*10^5}]][[-1, -1]]] (* Michael De Vlieger, Feb 08 2020 *)
    s[0]={1,2,3,4,5,7}; s[1]={0,6,9}; s[2]={8}; m[{sn_, t_}] := Union[Sort /@ Tuples[ s[sn], {t}]]; f[nd_, nh_] := Block[{v, pa = Tally /@ IntegerPartitions[ nh, {nd}, {0,1,2}], bst = Infinity}, Do[v = Flatten /@ Tuples[m /@ p]; Do[z = Select[ FromDigits /@ Select[ Permutations@ e, First[#] > 0 && OddQ@ Last@ # &], PrimeQ]; bst = Min[bst, {z}], {e, v}], {p, pa}]; bst]; a[0]=2; a[n_]:= Block[{nd = Ceiling[(n + 1)/2], b}, While[! IntegerQ@(b = f[nd, n]), nd++]; b]; a /@ Range[0, 30] (* Giovanni Resta, Feb 09 2020 *)
  • PARI
    \\ here b(n) is A064532.
    b(n)={vecsum([if(d==8,2, d==0||d==6||d==9) | d<-digits(n)])}
    a(n)={forprime(p=1, oo, if(b(p)==n, return(p)))} \\ Andrew Howroyd, Jan 31 2020

Extensions

a(13)-a(16) from Andrew Howroyd, Jan 31 2020
a(17)-a(19) from Jinyuan Wang, Feb 08 2020
a(20)-a(26) from Giovanni Resta, Feb 09 2020

A327462 Number of holes in decimal expansion of n-th prime.

Original entry on oeis.org

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

Views

Author

N. J. A. Sloane, Sep 27 2019

Keywords

Comments

This is A064692 restricted to the primes.

Crossrefs

Programs

  • PARI
    forprime (p=2, 439, print1 (vecsum(apply(d -> [1, 0, 0, 0, 1, 0, 1, 0, 2, 1][1+d], digits(p))) ", ")) \\ Rémy Sigrist, Sep 27 2019
Showing 1-2 of 2 results.