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.

User: Sebastian Karlsson

Sebastian Karlsson's wiki page.

Sebastian Karlsson has authored 19 sequences. Here are the ten most recent ones:

A377918 a(n) = index in A377912 (or, equally, in A342042) of the first n-digit term.

Original entry on oeis.org

1, 11, 77, 566, 4197, 31148, 231193, 1716043, 12737453, 94544693, 701765055, 5208903636, 38663477066, 286982552081, 2130149470506, 15811193864583, 117359769764941, 871111674250772, 6465891595866732, 47993564275737877, 356235822660837879, 2644187054283807954, 19626676300599636003
Offset: 1

Author

Keywords

Comments

These are the points in the graph of A342042 where the separate paths come together.
The first differences are in A377917, which is the more fundamental sequence. To get this sequence from A377917, add an initial zero, take partial sums, and add 1 to each term.

Crossrefs

Programs

  • Maple
    A377918 := proc(n) local S; option remember;
    S:=[1, 11, 77, 566, 4197, 31148, 231193, 1716043];
    if n <= 8 then S[n] else
    6*A377918(n-1)+10*A377918(n-2)+5*A377918(n-3)-5*A377918(n-4)-9*A377918(n-5)-5*A377918(n-6)-A377918(n-7); fi;
    end;
    [seq(A377918(i),i=1..20)];
  • Mathematica
    LinearRecurrence[{6, 10, 5, -5, -9, -5, -1}, {1, 11, 77, 566, 4197, 31148, 231193, 1716043}, 25] (* Paolo Xausa, Dec 02 2024  *)

Formula

G.f. = (x^7+6*x^6+15*x^5+19*x^4+11*x^3-x^2-5*x-1)/((1-x)*(x^6+6*x^5+15*x^4+20*x^3+15*x^2+5*x-1)) (From g.f. for A377917).
Recurrence: See Maple code.
The smallest root of the denominator of the g.f. is 0.134724138401519... whose reciprocal is (say) c1 = 7.422574840... Then a(n) is asymptotically c2*c1^n, for n >= 0, where c2 = 1.3824387... This is an excellent approximation. It gives a(22) = 0.1962667617*10^20, compared with a(22) = 19626676300599636003.
This also enables us to give a formula for the lower envelope of A342042 - see that entry for details.

Extensions

More terms added based on A377917. - N. J. A. Sloane, Dec 01 2024

A377917 Number of n-digit terms in A377912.

Original entry on oeis.org

10, 66, 489, 3631, 26951, 200045, 1484850, 11021410, 81807240, 607220362, 4507138581, 33454573430, 248319075015, 1843166918425, 13681044394077, 101548575900358, 753751904485831, 5594779921615960, 41527672679871145, 308242258385100002, 2287951231622970075, 16982489246315828049
Offset: 1

Author

Keywords

Comments

Also number of n-digit terms in A342042.
a(1149) has 1001 digits. - Michael S. Branicky, Nov 30 2024
The terms of A377912 as decimal digit strings are a regular language so can be counted using the transitions in a state machine matching those strings. - Kevin Ryde, Dec 01 2024

Examples

			The 66 two-digit terms in A377912 are
  10,11,12,13,14,15,16,17,18,19,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,
  38,39,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,67,68,69,70,71,72,73,74,
  75,76,77,78,79,89,90,91,92,93,94,95,96,97,98,99.
There is an obvious division into 5 blocks of size 10 and blocks of sizes 7, 5, 3, and 1.
		

Crossrefs

First differences of A377918.

Programs

  • Mathematica
    LinearRecurrence[{5, 15, 20, 15, 6, 1}, {10, 66, 489, 3631, 26951, 200045, 1484850}, 25] (* Paolo Xausa, Dec 01 2024 *)

Formula

From Kevin Ryde, Dec 01 2024: (Start)
a(n) = 5*a(n-1) + 15*a(n-2) + 20*a(n-3) + 15*a(n-4) + 6*a(n-5) + a(n-6) for n>=8.
G.f.: -1 + x + (1+x)^4 / (1 - 5*x - 15*x^2 - 20*x^3 - 15*x^4 - 6*x^5 - x^6). (End)

Extensions

a(6) and beyond from Michael S. Branicky, Nov 30 2024

A353776 a(n) = Sum_{d|n} (n/d mod d).

Original entry on oeis.org

0, 1, 1, 1, 1, 4, 1, 3, 1, 4, 1, 7, 1, 4, 6, 3, 1, 7, 1, 8, 5, 4, 1, 14, 1, 4, 4, 10, 1, 14, 1, 7, 6, 4, 8, 11, 1, 4, 5, 17, 1, 16, 1, 10, 13, 4, 1, 19, 1, 9, 6, 8, 1, 16, 7, 17, 5, 4, 1, 32, 1, 4, 13, 7, 9, 19, 1, 8, 6, 23, 1, 27, 1, 4, 10, 10, 12, 16, 1, 23
Offset: 1

Author

Sebastian Karlsson, May 07 2022

Keywords

Crossrefs

Programs

  • Haskell
    import Math.NumberTheory.ArithmeticFunctions
    a n = sum $ map (\d -> n `quot` d `rem` d) $ divisorsList n
    
  • Mathematica
    a[n_] := DivisorSum[n, Mod[n/#, #] &]; Array[a, 100] (* Amiram Eldar, May 07 2022 *)
  • PARI
    A353776(n) = sumdiv(n,d,((n/d)%d)); \\ Antti Karttunen, May 08 2022

A349423 Index of first occurrence of n in A348179, or -1 if n never appears.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 1020, 11, 1023, 31, 1024, 51, 1063, 71, 1028, 91, 20, 21012, 12, 220035, 24, 20025, 26, 20074, 28, 220095, 230, 13, 300025, 33, 10413, 53, 300026, 73, 300085, 93, 40, 1041, 42, 3000461, 14, 5041, 46, 700451, 48, 9041, 520, 15
Offset: 0

Author

Sebastian Karlsson, Nov 17 2021

Keywords

Examples

			a(10) = 1020, because 1020 is the first number k such that A348179(k) = 10.
a(1111111110) = -1 (found by _Kevin Ryde_).
		

Crossrefs

Programs

  • Python
    def A348179(n):
        s, l = str(n), len(str(n))
        return int("".join(s[(i + int(s[i])) % l] for i in range(l)))
    terms = {}
    for n in range(0, 3000462): # 3000462 to get all terms of the data-section without -1s.
        if (k := A348179(n)) not in terms: terms[k] = n
    for n in range(0, 52):
        try: print(terms[n], end=", ")
        except: print(-1, end=", ") # These -1s are conjectured.

A349422 Replace each decimal digit d of n with the digit that is d steps to the left of d. Interpret the digits of n as a cycle: one step to the left from the first digit is considered to be the last.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 11, 22, 31, 44, 51, 66, 71, 88, 91, 20, 22, 22, 22, 24, 22, 26, 22, 28, 22, 0, 13, 22, 33, 44, 53, 66, 73, 88, 93, 40, 44, 42, 44, 44, 44, 46, 44, 48, 44, 0, 15, 22, 35, 44, 55, 66, 75, 88, 95, 60, 66, 62, 66, 64, 66, 66, 66, 68, 66, 0, 17, 22, 37, 44, 57, 66, 77, 88, 97, 80, 88, 82, 88, 84, 88, 86, 88, 88, 88, 0, 19, 22, 39, 44, 59, 66, 79, 88, 99, 0, 100
Offset: 0

Author

Sebastian Karlsson, Nov 17 2021

Keywords

Comments

First differs from A348179 at a(101).

Examples

			a(3210) = 2020, because:
Moving 3 steps to the left from 3 gives: 3 -> 0 -> 1 -> 2.
Moving 2 steps to the left from 2 gives: 2 -> 3 -> 0.
Moving 1 step to the left from 1 gives: 1 -> 2.
Moving 0 steps to left from 0 gives: 0.
		

Crossrefs

Cf. A336668 (fixed points), A348179 (to the right).

Programs

  • Haskell
    import Data.Char (digitToInt)
    a n = read [s !! mod (i - digitToInt (s !! i)) l | i <- [0..l-1]] :: Integer
        where s = show n; l = length s
    
  • PARI
    a(n) = { my (d=digits(n)); fromdigits(vector(#d, k, d[1+(k-1-d[k])%#d])) } \\ Rémy Sigrist, Nov 17 2021
  • Python
    def a(n):
        s, l = str(n), len(str(n))
        return int("".join(s[(i - int(s[i])) % l] for i in range(l)))
    

A348179 Replace each decimal digit d of n with the digit that is d steps to the right of d. Interpret the digits of n as a cycle: one step to the right from the last digit is considered to be the first.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 11, 22, 31, 44, 51, 66, 71, 88, 91, 20, 22, 22, 22, 24, 22, 26, 22, 28, 22, 0, 13, 22, 33, 44, 53, 66, 73, 88, 93, 40, 44, 42, 44, 44, 44, 46, 44, 48, 44, 0, 15, 22, 35, 44, 55, 66, 75, 88, 95, 60, 66, 62, 66, 64, 66, 66, 66, 68, 66, 0, 17, 22, 37, 44, 57, 66, 77, 88, 97, 80, 88, 82, 88, 84, 88, 86, 88, 88, 88, 0, 19, 22, 39, 44, 59, 66, 79, 88, 99, 0, 1
Offset: 0

Author

Sebastian Karlsson, Oct 05 2021

Keywords

Comments

First differs from A349422 at a(101). - Sebastian Karlsson, Dec 31 2021

Examples

			a(102345) = 004124 = 4124. For example, 4 gets replaced by 2 because moving 4 steps to the right gives: 4 -> 5 -> 1 -> 0 -> 2. Note that from 5 we went to the first digit of the number.
		

Crossrefs

Cf. A336668 (fixed points), A349422 (to the left), A349423 (index of first appearance of n).

Programs

  • Haskell
    import Data.Char (digitToInt)
    a n = let s = show n; l = length s in
      read [s !! (mod (i + digitToInt (s !! i)) l) | i <- [0..l-1]] :: Integer
    
  • Mathematica
    Table[FromDigits@Table[v[[If[(p=Mod[k+v[[k]],t])==0,t,p]]],{k,t=Length[v=IntegerDigits[n]]}],{n,0,67}] (* Giorgos Kalogeropoulos, Oct 08 2021 *)
  • PARI
    f(k, d) = d[(k+d[k]-1)%#d + 1];
    a(n) = my(d=digits(n), dd=vector(#d, k, f(k, d))); fromdigits(dd); \\ Michel Marcus, Oct 07 2021
  • Python
    def a(n):
        s, l = str(n), len(str(n))
        return int("".join(s[(i + int(s[i])) % l] for i in range(l)))
    

Extensions

a(68)-a(101) from Sebastian Karlsson, Dec 31 2021

A346148 Square array read by descending antidiagonals: T(n, k) = mu^n(k) where mu^1(k) = mu(k) = A008683(k) and for each n >= 1, mu^(n+1)(k) is the Dirichlet convolution of mu(k) and mu^n(k).

Original entry on oeis.org

1, -1, 1, -1, -2, 1, 0, -2, -3, 1, -1, 1, -3, -4, 1, 1, -2, 3, -4, -5, 1, -1, 4, -3, 6, -5, -6, 1, 0, -2, 9, -4, 10, -6, -7, 1, 0, 0, -3, 16, -5, 15, -7, -8, 1, 1, 1, -1, -4, 25, -6, 21, -8, -9, 1, -1, 4, 3, -4, -5, 36, -7, 28, -9, -10, 1, 0, -2, 9, 6, -10, -6
Offset: 1

Author

Sebastian Karlsson, Aug 20 2021

Keywords

Examples

			  n\k| 1    2    3    4    5    6    7    8    9   10   11    12 ...
  ---+--------------------------------------------------------------
   1 | 1   -1   -1    0   -1    1   -1    0    0    1   -1     0 ...
   2 | 1   -2   -2    1   -2    4   -2    0    1    4   -2    -2 ...
   3 | 1   -3   -3    3   -3    9   -3   -1    3    9   -3    -9 ...
   4 | 1   -4   -4    6   -4   16   -4   -4    6   16   -4   -24 ...
   5 | 1   -5   -5   10   -5   25   -5  -10   10   25   -5   -50 ...
   6 | 1   -6   -6   15   -6   36   -6  -20   15   36   -6   -90 ...
   7 | 1   -7   -7   21   -7   49   -7  -35   21   49   -7  -147 ...
   8 | 1   -8   -8   28   -8   64   -8  -56   28   64   -8  -224 ...
   9 | 1   -9   -9   36   -9   81   -9  -84   36   81   -9  -324 ...
  10 | 1  -10  -10   45  -10  100  -10 -120   45  100  -10  -450 ...
  11 | 1  -11  -11   55  -11  121  -11 -165   55  121  -11  -605 ...
  12 | 1  -12  -12   66  -12  144  -12 -220   66  144  -12  -792 ...
  13 | 1  -13  -13   78  -13  169  -13 -286   78  169  -13 -1014 ...
  14 | 1  -14  -14   91  -14  196  -14 -364   91  196  -14 -1274 ...
  15 | 1  -15  -15  105  -15  225  -15 -455  105  225  -15 -1575 ...
  ...
		

Crossrefs

Main diagonal gives A341837.

Programs

  • Mathematica
    T[n_, k_] := If[k == 1, 1, Product[(-1)^e Binomial[n, e], {e, FactorInteger[k][[All, 2]]}]];
    Table[T[n-k+1, k], {n, 1, 12}, {k, n, 1, -1}] // Flatten (* Jean-François Alcover, Sep 13 2021 *)
  • PARI
    T(n, k) = my(f=factor(k)); for (k=1, #f~, f[k,1] = binomial(n, f[k,2])*(-1)^f[k,2]; f[k,2]=1); factorback(f); \\ Michel Marcus, Aug 21 2021
  • Python
    from sympy import binomial, primefactors as pf, multiplicity as mult
    from math import prod
    def T(n, k):
        return prod((-1)**mult(p, k)*binomial(n, mult(p, k)) for p in pf(k))
    

Formula

If k = Product (p_j^m_j) then T(n, k) = Product (binomial(n, m_j)*(-1)^m_j).
Dirichlet g.f. of the n-th row: 1/zeta^n(s).
T(n, p) = -n.
T(n, n) = A341837(n).

A344683 Dirichlet convolution of the Euler totient function with itself, applied twice.

Original entry on oeis.org

1, 3, 6, 9, 12, 18, 18, 25, 30, 36, 30, 54, 36, 54, 72, 66, 48, 90, 54, 108, 108, 90, 66, 150, 108, 108, 134, 162, 84, 216, 90, 168, 180, 144, 216, 270, 108, 162, 216, 300, 120, 324, 126, 270, 360, 198, 138, 396, 234, 324, 288, 324, 156, 402, 360, 450, 324
Offset: 1

Author

Sebastian Karlsson, Aug 17 2021

Keywords

Comments

Dirichlet convolution of A000010 with A029935.

Crossrefs

Programs

  • Mathematica
    f[p_, e_] := (1/2)*(p - 1)*p^(e - 3)*(e^2*(p - 1)^2 + 3*e*(p^2 - 1) + 2*(p^2 + p + 1)); a[1] = 1; a[n_] := Times @@ f @@@ FactorInteger[n]; Array[a, 100] (* Amiram Eldar, Aug 17 2021 *)
  • Python
    from sympy import divisors as div, totient as phi
    def D(f, g, n):
        return sum(f(d)*g(n//d) for d in div(n))
    def phi_o_phi(n):
        return D(phi, phi, n)
    def a(n):
        return D(phi, phi_o_phi, n)

Formula

Dirichlet g.f.: zeta(s - 1)^3 / zeta(s)^3.
Multiplicative with a(p^e) = (1/2)*(p-1)*p^(e-3)*(e^2*(p-1)^2 + 3*e*(p^2-1) + 2*(p^2 + p + 1)).
Sum_{k=1..n} a(k) ~ 27*n^2/Pi^10 * (2*Pi^4*log(n)^2 - 2*Pi^4*log(n)*(1 + 6*log(2) - 72*(1/12 - zeta'(-1)) + 6*log(Pi)) + Pi^4*(1 + 6*gamma*(2*gamma - 1) - 12*sg1) + 864*zeta'(2)^2 - 36*Pi^2*((6*gamma - 1)*zeta'(2) + zeta''(2))), where gamma is the Euler-Mascheroni constant A001620 and sg1 is the first Stieltjes constant (see A082633). - Vaclav Kotesovec, Jun 24 2022

A341953 Replace each digit d in the decimal representation of n with the digital root of d^n.

Original entry on oeis.org

1, 4, 9, 4, 2, 9, 7, 1, 9, 10, 11, 11, 19, 17, 18, 19, 14, 11, 19, 40, 81, 77, 59, 11, 25, 49, 81, 71, 59, 90, 91, 94, 99, 94, 92, 99, 97, 91, 99, 40, 71, 11, 49, 77, 18, 49, 74, 11, 49, 70, 81, 47, 29, 11, 55, 79, 81, 41, 29, 90, 91, 94, 99, 94, 92, 99, 97
Offset: 1

Author

Sebastian Karlsson, Feb 24 2021

Keywords

Comments

The digits 0, 1, 3, 6 and 9 will always be replaced by the same digits: 0 -> 0, 1 -> 1, 3 -> 9, 6 -> 9 and 9 -> 9.

Examples

			a(14) = 17, since 1^14 = 1 and 4^14 = 268435456. 2 + 6 + 8 + 4 + 3 + 5 + 4 + 5 + 6 = 43 and 4 + 3 = 7. Thus, the digital root of 268435456 is 7. This means that for 14, "1" gets replaced by "1" and "4" gets replaced by "7".
		

Programs

  • Mathematica
    digroot[n_] := If[n == 0, 0, Mod[n - 1, 9] + 1]; a[n_] := FromDigits[digroot /@ (IntegerDigits[n]^n)]; Array[a, 100] (* Amiram Eldar, Feb 24 2021 *)
  • PARI
    r(n) = if(n, (n-1)%9+1) \\ A010888
    a(n) = fromdigits(apply(x->r(x^n), digits(n))); \\ Michel Marcus, Mar 21 2021
  • Python
    def D(d, n):
        return 0 if d == 0 else (pow(d, n, 9)-1)%9 + 1
    def a(n):
        return int(''.join(str(D(int(d), n)) for d in str(n)))
    

A341767 Replace each digit d in the decimal representation of n with the digital root of n^d.

Original entry on oeis.org

1, 4, 9, 4, 2, 9, 7, 1, 9, 11, 22, 39, 41, 54, 69, 71, 88, 99, 11, 41, 93, 77, 78, 99, 44, 11, 99, 11, 48, 91, 14, 87, 99, 17, 88, 99, 11, 84, 99, 41, 45, 99, 71, 11, 99, 11, 72, 99, 41, 21, 96, 44, 88, 99, 11, 51, 99, 77, 28, 91, 17, 11, 99, 11, 15, 99, 14
Offset: 1

Author

Sebastian Karlsson, Feb 19 2021

Keywords

Comments

If n == 1 (mod 9), then every digit will be replaced by "1". If n == 0 (mod 9), then all nonzero digits will be replaced by "9".
The corresponding n of values a(n)= 1, a(n)= 11, a(n)= 111,... creates a subsequence of A236653. - Davide Rotondo, Mar 04 2024

Examples

			a(26) = 11, since 26^2 = 676 and 26^6 = 308915776. 6 + 7 + 6 = 19, 1 + 9 = 10 and 1 + 0 = 1, so the digital root of 676 is 1. 3 + 0 + 8 + 9 + 1 + 5 + 7 + 7 + 6 = 46, 4 + 6 = 10 and 1 + 0 = 1, so the digital root of 308915776 is 1. Thus, for 26, both "2" and "6" will be replaced by "1".
		

Crossrefs

Programs

  • Mathematica
    a[n_] := FromDigits[Mod[n^IntegerDigits[n] - 1, 9] + 1]; Array[a, 100] (* Amiram Eldar, Feb 19 2021 *)
  • PARI
    dr(n) = if(n, (n-1)%9+1); \\ A010888
    a(n) = my(d=digits(n)); fromdigits(vector(#d, k, dr(n^d[k]))); \\ Michel Marcus, Feb 19 2021
  • Python
    def a(n):
        return int(''.join(str((pow(n, int(d), 9)-1)%9 + 1) for d in str(n)))
    

Formula

a(10*n) = 10*a(n) + 1.