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.

A276150 Sum of digits when n is written in primorial base (A049345); minimal number of primorials (A002110) that add to n.

Original entry on oeis.org

0, 1, 1, 2, 2, 3, 1, 2, 2, 3, 3, 4, 2, 3, 3, 4, 4, 5, 3, 4, 4, 5, 5, 6, 4, 5, 5, 6, 6, 7, 1, 2, 2, 3, 3, 4, 2, 3, 3, 4, 4, 5, 3, 4, 4, 5, 5, 6, 4, 5, 5, 6, 6, 7, 5, 6, 6, 7, 7, 8, 2, 3, 3, 4, 4, 5, 3, 4, 4, 5, 5, 6, 4, 5, 5, 6, 6, 7, 5, 6, 6, 7, 7, 8, 6, 7, 7, 8, 8, 9, 3, 4, 4, 5, 5, 6, 4, 5, 5, 6, 6, 7, 5, 6, 6, 7, 7, 8, 6, 7, 7, 8, 8, 9, 7, 8, 8, 9, 9, 10, 4
Offset: 0

Views

Author

Antti Karttunen, Aug 22 2016

Keywords

Comments

The sum of digits of n in primorial base is odd if n is 1 or 2 (mod 4) and even if n is 0 or 3 (mod 4). Proof: primorials are 1 or 2 (mod 4) and a(n) can be constructed via the greedy algorithm. So if n = 4k + r where 0 <= r < 4, 4k needs an even number of primorials and r needs hammingweight(r) = A000120(r) primorials. Q.E.D. - David A. Corneth, Feb 27 2019

Examples

			For n=24, which is "400" in primorial base (as 24 = 4*(3*2*1) + 0*(2*1) + 0*1, see A049345), the sum of digits is 4, thus a(24) = 4.
		

Crossrefs

Cf. A333426 [k such that a(k)|k], A339215 [numbers not of the form x+a(x) for any x], A358977 [k such that gcd(k, a(k)) = 1].
Cf. A014601, A042963 (positions of even and odd terms), A343048 (positions of records).
Differs from analogous A034968 for the first time at n=24.

Programs

  • Mathematica
    nn = 120; b = MixedRadix[Reverse@ Prime@ NestWhileList[# + 1 &, 1, Times @@ Prime@ Range[# + 1] <= nn &]]; Table[Total@ IntegerDigits[n, b], {n, 0, nn}] (* Version 10.2, or *)
    nn = 120; f[n_] := Block[{a = {{0, n}}}, Do[AppendTo[a, {First@ #, Last@ #} &@ QuotientRemainder[a[[-1, -1]], Times @@ Prime@ Range[# - i]]], {i, 0, #}] &@ NestWhile[# + 1 &, 0, Times @@ Prime@ Range[# + 1] <= n &]; Rest[a][[All, 1]]]; Table[Total@ f@ n, {n, 0, 120}] (* Michael De Vlieger, Aug 26 2016 *)
  • PARI
    A276150(n) = { my(s=0, p=2, d); while(n, d = (n%p); s += d; n = (n-d)/p; p = nextprime(1+p)); (s); }; \\ Antti Karttunen, Feb 27 2019
  • Python
    from sympy import prime, primefactors
    def Omega(n): return 0 if n==1 else Omega(n//primefactors(n)[0]) + 1
    def a276086(n):
        i=0
        m=pr=1
        while n>0:
            i+=1
            N=prime(i)*pr
            if n%N!=0:
                m*=(prime(i)**((n%N)/pr))
                n-=n%N
            pr=N
        return m
    def a(n): return Omega(a276086(n))
    print([a(n) for n in range(201)]) # Indranil Ghosh, Jun 23 2017
    

Formula

a(n) = 1 + a(A276151(n)) = 1 + a(n-A002110(A276084(n))), a(0) = 0.
or for n >= 1: a(n) = 1 + a(n-A260188(n)).
Other identities and observations. For all n >= 0:
a(n) = A001222(A276086(n)) = A001222(A278226(n)).
a(n) >= A371091(n) >= A267263(n).
From Antti Karttunen, Feb 27 2019: (Start)
a(n) = A000120(A277022(n)).
a(A283477(n)) = A324342(n).
(End)
a(n) = A373606(n) + A373607(n). - Antti Karttunen, Jun 19 2024

A339211 Zeckendorf self numbers: numbers not of the form k + A007895(k).

Original entry on oeis.org

1, 5, 7, 10, 19, 21, 27, 29, 32, 36, 40, 42, 45, 54, 61, 63, 66, 75, 77, 83, 85, 88, 95, 97, 100, 109, 111, 117, 119, 122, 126, 130, 132, 135, 144, 146, 150, 152, 155, 164, 166, 172, 174, 177, 181, 185, 187, 190, 199, 206, 208, 211, 220, 222, 228, 230, 233, 239
Offset: 1

Views

Author

Amiram Eldar, Nov 27 2020

Keywords

Comments

Analogous to self numbers (A003052) using the Zeckendorf representation (A014417) instead of decimal expansion.
The numbers of terms that do not exceed 10^k, for k = 0, 1, ..., are 1, 4, 25, 236, 2351, 23495, 234949, 2349463, 23494586, 234945839, 2349458364, ... . Apparently, the asymptotic density of this sequence exists and equals 0.23494583... . - Amiram Eldar, Aug 08 2025

References

  • József Sándor and Borislav Crstici, Handbook of Number theory II, Kluwer Academic Publishers, 2004, Chapter 4, p. 384-386.

Crossrefs

Programs

  • Mathematica
    z[n_] := n + Length[DeleteCases[NestWhileList[# - Fibonacci[Floor[Log[Sqrt[5]*# + 3/2]/Log[GoldenRatio]]] &, n, # > 1 &], 0]]; m = 250; Complement[Range[m], Array[z, m]] (* after Alonso del Arte at A007895 *)

A339212 Dual-Zeckendorf self numbers: numbers not of the form k + A112310(k).

Original entry on oeis.org

1, 4, 8, 10, 14, 17, 19, 28, 31, 33, 39, 41, 50, 53, 55, 59, 63, 66, 68, 74, 76, 85, 88, 90, 97, 106, 109, 111, 115, 119, 122, 124, 130, 132, 141, 144, 146, 153, 156, 158, 164, 166, 175, 178, 180, 187, 196, 199, 201, 205, 209, 212, 214, 220, 222, 231, 234, 236
Offset: 1

Views

Author

Amiram Eldar, Nov 27 2020

Keywords

Comments

Analogous to self numbers (A003052) using the dual Zeckendorf representation (A104326) instead of decimal expansion.

References

  • József Sándor and Borislav Crstici, Handbook of Number theory II, Kluwer Academic Publishers, 2004, Chapter 4, p. 384-386.

Crossrefs

Programs

  • Mathematica
    fibTerms[n_] := Module[{k = Ceiling[Log[GoldenRatio, n*Sqrt[5]]], t = n, fr = {}}, While[k > 1, If[t >= Fibonacci[k], AppendTo[fr, 1]; t = t - Fibonacci[k], AppendTo[fr, 0]]; k--]; fr]; dzs[n_] := n + Module[{v = fibTerms[n]}, nv = Length[v]; i = 1; While[i <= nv - 2, If[v[[i]] == 1 && v[[i + 1]] == 0 && v[[i + 2]] == 0, v[[i]] = 0; v[[i + 1]] = 1; v[[i + 2]] = 1; If[i > 2, i -= 3]]; i++]; i = Position[v, _?(# > 0 &)]; If[i == {}, 0, Total[v[[i[[1, 1]] ;; -1]]]]]; m = 240; Complement[Range[m], Array[dzs, m]]

A339213 Phi-base self numbers: positive numbers not of the form k + A055778(k).

Original entry on oeis.org

1, 3, 6, 10, 12, 15, 19, 23, 26, 30, 32, 38, 41, 43, 52, 55, 59, 61, 64, 68, 72, 75, 79, 81, 86, 89, 91, 97, 101, 104, 108, 110, 115, 118, 120, 126, 131, 135, 137, 140, 144, 148, 151, 155, 157, 163, 166, 168, 177, 180, 184, 186, 189, 193, 197, 200, 204, 206, 213
Offset: 1

Views

Author

Amiram Eldar, Nov 27 2020

Keywords

Comments

Analogous to self numbers (A003052) using base phi (A130600) instead of base 10.

References

  • József Sándor and Borislav Crstici, Handbook of Number theory II, Kluwer Academic Publishers, 2004, Chapter 4, p. 384-386.

Crossrefs

Programs

  • Mathematica
    s[1] = 2; s[n_] := n + Plus @@ RealDigits[n, GoldenRatio, 2*Ceiling[Log[GoldenRatio, n]]][[1]]; m = 220; Complement[Range[m], Array[s, m]]

A339214 Factorial-base self numbers: numbers not of the form k + A034968(k).

Original entry on oeis.org

1, 4, 11, 18, 36, 43, 61, 68, 86, 93, 111, 118, 125, 132, 139, 157, 164, 182, 189, 207, 214, 232, 239, 246, 253, 260, 278, 285, 303, 310, 328, 335, 353, 360, 367, 374, 381, 399, 406, 424, 431, 449, 456, 474, 481, 488, 495, 502, 520
Offset: 1

Views

Author

Amiram Eldar, Nov 27 2020

Keywords

Comments

Analogous to self numbers (A003052) using factorial base representation (A007623) instead of decimal expansion.
The numbers of terms that do not exceed 10^k, for k = 0, 1, ..., are 1, 2, 10, 90, 878, 8749, 87455, 874499, 8744934, 87449296, 874492907, ... . Apparently, the asymptotic density of this sequence exists and equals 0.08744929... . - Amiram Eldar, Aug 08 2025

References

  • József Sándor and Borislav Crstici, Handbook of Number theory II, Kluwer Academic Publishers, 2004, Chapter 4, p. 384-386.

Crossrefs

Programs

  • Mathematica
    max = 6; s[n_] := n + Plus @@ IntegerDigits[n, MixedRadix[Range[max, 2, -1]]]; m = max!; Complement[Range[m], Array[s, m]]

A342729 Self numbers in base i-1: numbers not of the form k + A066323(k).

Original entry on oeis.org

1, 3, 5, 7, 9, 22, 24, 26, 39, 41, 43, 56, 58, 60, 73, 75, 77, 90, 92, 94, 107, 109, 111, 136, 138, 140, 153, 155, 157, 170, 172, 174, 199, 201, 203, 216, 218, 220, 233, 235, 237, 262, 264, 266, 279, 281, 283, 296, 298, 300, 313, 315, 317, 330, 332, 334, 347, 349
Offset: 1

Views

Author

Amiram Eldar, Mar 19 2021

Keywords

Comments

Equivalently, self numbers in base -4, since A066323(k) is also the sum of the digits of k in base -4.
Analogous to self numbers (A003052) using base i-1 representation (A271472) instead of decimal expansion.
The number of terms not exceeding 10^k, for k=1,2,..., is 5, 20, 155, 1507, 15008, 150007, 1500014, 15000011. Is the asymptotic density of this sequence exactly 3/20?

References

  • József Sándor and Borislav Crstici, Handbook of Number theory II, Kluwer Academic Publishers, 2004, Chapter 4, p. 384-386.

Crossrefs

Similar sequences: A003052 (decimal), A010061 (binary), A010064 (base 4), A010067 (base 6), A010070 (base 8), A339211 (Zeckendorf), A339212 (dual Zeckendorf), A339213 (base phi), A339214 (factorial base), A339215 (primorial base).

Programs

  • Mathematica
    s[n_] := Module[{v = {{0, 0, 0, 0}, {0, 0, 0, 1}, {1, 1, 0, 0}, {1, 1, 0, 1}}}, Plus @@ Flatten @ v[[1 + Reverse @ Most[Mod[NestWhileList[(# - Mod[#, 4])/-4 &, n, # != 0 &], 4]]]]]; f[n_] := n + s[n]; m = 1000; Complement[Range[m], Select[Union@Array[f, m], # <= m &]]

A344512 a(n) is the least number larger than 1 which is a self number in all the bases 2 <= b <= n.

Original entry on oeis.org

4, 13, 13, 13, 287, 287, 2971, 2971, 27163, 27163, 90163, 90163, 5940609, 5940609, 6069129, 6069129, 276404649, 276404649
Offset: 2

Views

Author

Amiram Eldar, May 21 2021

Keywords

Comments

Since the sequence of base-b self numbers for odd b is the sequence of the odd numbers (A005408) (Joshi, 1973), all the terms beyond a(2) are odd numbers.
For the corresponding sequence with only even bases, see A344513.
a(20) > 1.5*10^10, if it exists.

Examples

			a(2) = 4 since the least binary self number after 1 is A010061(2) = 4.
a(3) = 13 since the least binary self number after 1 which is also a self number in base 3 is A010061(4) = 13.
		

References

  • Vijayshankar Shivshankar Joshi, Contributions to the theory of power-free integers and self-numbers, Ph.D. dissertation, Gujarat University, Ahmedabad (India), October, 1973.
  • József Sándor and Borislav Crstici, Handbook of Number theory II, Kluwer Academic Publishers, 2004, Chapter 4, p. 384-386.

Crossrefs

Programs

  • Mathematica
    s[n_, b_] := n + Plus @@ IntegerDigits[n, b]; selfQ[n_, b_] := AllTrue[Range[n, n - (b - 1) * Ceiling @ Log[b, n], -1], s[#, b] != n &]; a[2] = 4; a[b_] := a[b] = Module[{n = a[b - 1]}, While[! AllTrue[Range[2, b], selfQ[n, #] &], n++]; n]; Array[a, 10, 2]

Formula

a(2*n+1) = a(2*n) for n >= 2.

A344513 a(n) is the least number larger than 1 which is a self number in all the even bases b = 2*k for 1 <= k <= n.

Original entry on oeis.org

4, 13, 287, 294, 6564, 90163, 1136828, 3301262, 276404649, 5643189146
Offset: 1

Views

Author

Amiram Eldar, May 21 2021

Keywords

Comments

Joshi (1973) proved that for all odd b the sequence of base-b self numbers is the sequence of odd numbers (A005408). Therefore, in this sequence the bases are restricted to even values. For the corresponding sequence with both odd and even bases, see A344512.

Examples

			a(1) = 4 since the least binary self number after 1 is A010061(2) = 4.
a(2) = 13 since the least binary self number after 1 which is also a self number in base 2*2 = 4 is A010061(4) = A010064(4) = 13.
		

References

  • Vijayshankar Shivshankar Joshi, Contributions to the theory of power-free integers and self-numbers, Ph.D. dissertation, Gujarat University, Ahmedabad (India), October, 1973.
  • József Sándor and Borislav Crstici, Handbook of Number theory II, Kluwer Academic Publishers, 2004, Chapter 4, p. 384-386.

Crossrefs

Programs

  • Mathematica
    s[n_, b_] := n + Plus @@ IntegerDigits[n, b]; selfQ[n_, b_] := AllTrue[Range[n, n - (b - 1) * Ceiling @ Log[b, n], -1], s[#, b] != n &]; a[1] = 4; a[n_] := a[n] = Module[{k = a[n - 1]}, While[! AllTrue[Range[1, n], selfQ[k, 2*#] &], k++]; k]; Array[a, 7]
Showing 1-8 of 8 results.