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

A359245 The smallest square with exactly n circular loops (or holes) in its decimal expansion (A064532).

Original entry on oeis.org

1, 0, 81, 289, 1089, 8836, 6889, 80089, 688900, 1868689, 8508889, 29888089, 288898009, 983888689, 3808988089, 8680089889, 86908808809, 488088068689, 878686888689, 2888986888804, 48890888808804, 108506888888896, 88869893888889, 880881089888881, 788088668888889
Offset: 0

Views

Author

Bernard Schott, Dec 22 2022

Keywords

Comments

The digit 8 has two loops, the digits 0, 6 and 9 have one loop, and other digits (including 4) have no hole.
Least square k such that A064532(k) = n.

Examples

			a(3) = 289 because 8 has two loops and 9 has one loop for a total of 3, and 289 is the smallest such square.
		

Crossrefs

Cf. A064532.
Similar: A331898 (primes), A337842 (palindromes).

Programs

  • PARI
    a(n) = { for (k=0, oo, my (d=digits(k^2)); if (n==(k==0)+sum(i=1, #d, [1, 0, 0, 0, 0, 0, 1, 0, 2, 1][1+d[i]]), return (k^2))) } \\ Rémy Sigrist, Dec 22 2022

Extensions

More terms from Rémy Sigrist, Dec 22 2022

A064692 Total number of holes in decimal expansion of the number n, assuming 4 has 1 hole.

Original entry on oeis.org

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

Views

Author

Matthew Conroy, Oct 11 2001

Keywords

Examples

			We assume decimal digits 1,2,3,5,7 have no hole; 0,4,6,9 have one hole each; 8 has two holes. So a(148)=3.
		

Crossrefs

Programs

  • Mathematica
    Table[DigitCount[x].{0, 0, 0, 1, 0, 1, 0, 2, 1, 1}, {x, 0, 104}] (* Zak Seidov, Jul 25 2015 *)
  • Python
    def A064692(n):
        x=str(n)
        return x.count("0")+x.count("4")+x.count("6")+x.count("8")*2+x.count("9") # Indranil Ghosh, Feb 02 2017

Formula

a(A001742(n)) = 0. - Michel Marcus, Jul 25 2015

A064530 Number of holes in n-th capital letter of English alphabet.

Original entry on oeis.org

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

Views

Author

N. J. A. Sloane, Oct 07 2001

Keywords

Examples

			A has one hole, B has two, etc.
		

Crossrefs

Equals A064529 - 1. Cf. A064531, A064532, A208568.

A064531 Number of connected components remaining when decimal expansion of the number n is cut from a piece of paper.

Original entry on oeis.org

2, 1, 1, 1, 1, 1, 2, 1, 3, 2, 2, 1, 1, 1, 1, 1, 2, 1, 3, 2, 2, 1, 1, 1, 1, 1, 2, 1, 3, 2, 2, 1, 1, 1, 1, 1, 2, 1, 3, 2, 2, 1, 1, 1, 1, 1, 2, 1, 3, 2, 2, 1, 1, 1, 1, 1, 2, 1, 3, 2, 3, 2, 2, 2, 2, 2, 3, 2, 4, 3, 2, 1, 1, 1, 1, 1, 2, 1, 3, 2, 4, 3, 3, 3, 3, 3, 4, 3, 5, 4, 3, 2, 2, 2, 2, 2, 3, 2, 4, 3, 3, 2, 2, 2, 2
Offset: 0

Views

Author

N. J. A. Sloane, Oct 07 2001

Keywords

Comments

Assumes that 4 is represented without a hole.

Crossrefs

Cf. A064529, A064530. Equals A064532 + 1.

Programs

  • Mathematica
    a[n_ /; 0 <= n <= 9] := a[n] = {2, 1, 1, 1, 1, 1, 2, 1, 3, 2}[[n + 1]]; a[n_] := Total[a /@ (id = IntegerDigits[n])] - Length[id] + 1 ; Table[a[n], {n, 0, 104}] (* Jean-François Alcover, Nov 22 2013 *)

Extensions

More terms from Matthew Conroy, Oct 09 2001

A064529 Number of connected components remaining when n-th letter of English alphabet is cut from a piece of paper.

Original entry on oeis.org

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

Views

Author

N. J. A. Sloane, Oct 07 2001

Keywords

Crossrefs

Equals A064530 + 1. Cf. A064531, A064532.

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

A337842 The smallest palindrome with exactly n circular loops (or holes) in its decimal representation.

Original entry on oeis.org

1, 0, 8, 606, 88, 808, 888, 68086, 8888, 88088, 88888, 6880886, 888888, 8880888, 8888888, 688808886, 88888888, 888808888, 888888888, 68888088886, 8888888888, 88888088888, 88888888888, 6888880888886, 888888888888, 8888880888888, 8888888888888, 688888808888886
Offset: 0

Views

Author

Bernard Schott, Sep 25 2020

Keywords

Comments

The decimal digits 1, 2, 3, 5, 7 have no hole, and 4 is represented without a hole; otherwise, 0, 6, 9 have one hole each and 8 has two holes.
Least palindrome q such that A064532(q) = n.
Except for a(0) = 1, each term has only digits 0, 6 or 8 in its decimal expansion.

Examples

			a(3) = 606 because 6 and 0 have each one circular loop for a total of 3.
		

Crossrefs

Cf. A331898 (similar for primes).

Programs

Formula

a(2m) = A002282(m) for m >= 1.
a(4m+1) = A332180(m) for m >= 1.
a(4m+3) = 6 * A000533(2m+2) + 10 * A332180(m) for m >= 0.

Extensions

More terms from Amiram Eldar, Sep 25 2020

A358439 Number of even digits necessary to write all positive n-digit integers.

Original entry on oeis.org

4, 85, 1300, 17500, 220000, 2650000, 31000000, 355000000, 4000000000, 44500000000, 490000000000, 5350000000000, 58000000000000, 625000000000000, 6700000000000000, 71500000000000000, 760000000000000000, 8050000000000000000, 85000000000000000000, 895000000000000000000
Offset: 1

Views

Author

Bernard Schott, Nov 16 2022

Keywords

Comments

If nonnegative n-digit integers were considered, then a(1) would be 5.
Also, a(n) is the total number of holes in all positive n-digit integers, assuming 4 has no hole. Digits 0, 6 and 9 have 1 hole, digit 8 has 2 holes, and other digits have no holes or (circular) loops (as in A064532).
Proof of the first formula: For n>=2, to write all positive n-digit integers, digits 6, 8, 9 occur A081045(n-1) = (9n+1)*10^(n-2) times each, and digit 0 occurs A212704(n-1) = 9*(n-1)*10^(n-2) times; so a(n) = 4*A081045(n-1) + A212704(n-1).
For a(1), if 0 were included then there would be 5 holes in the 1-digit numbers 0..9.

Examples

			To write the integers from 10 up to 99, each of the digits 2, 4, 6 and 8 must be used 19 times, and digit 0 must be used 9 times hence a(2) = 4*19 + 9 = 85.
		

Crossrefs

Programs

  • Maple
    seq((5*(9*n-1))*10^(n-2), n = 1 .. 30);
  • Mathematica
    a[n_] := 5*(9*n - 1)*10^(n - 2); Array[a, 22] (* Amiram Eldar, Nov 16 2022 *)

Formula

a(n) = 5*(9n-1)*10^(n-2).
Formulas coming from the name with even digits:
a(n) = A358854(10^n-1) - A358854(10^(n-1)-1).
a(n) = A113119(n) - A359271(n) for n >= 2.
Formula coming from the comment with holes:
a(n) = Sum_{k=10^(n-1)..10^n-1} A064532(k).
Showing 1-8 of 8 results.