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.

Previous Showing 11-20 of 197 results. Next

A034837 Numbers that are divisible by the first, i.e., the leftmost, digit.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 22, 24, 26, 28, 30, 33, 36, 39, 40, 44, 48, 50, 55, 60, 66, 70, 77, 80, 88, 90, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122
Offset: 1

Views

Author

Keywords

Comments

A 10-automatic sequence. - Charles R Greathouse IV, Jun 13 2017

Crossrefs

Cf. A034709 (divisible by last digit).

Programs

  • Haskell
    import Data.Char (digitToInt)
    a034837 n = a034837_list !! (n-1)
    a034837_list = filter (\i -> i `mod` (a000030 i) == 0) [1..]
    -- Reinhard Zumkeller, Jun 19 2011
    
  • Mathematica
    Select[Range[150],Divisible[#,IntegerDigits[#][[1]]]&] (* Harvey P. Dale, Jul 11 2017 *)
  • PARI
    for(n=1,1000,n%(Vecsmall(Str(n))[1]-48) || print1(n",")) \\ M. F. Hasler, Jun 19 2011
    
  • PARI
    a(n)=for(k=1,1e9,k%(Vecsmall(Str(k))[1]-48) || n-- || return(k)) \\  M. F. Hasler, Jun 19 2011
    
  • Python
    def ok(n): return n and n%int(str(n)[0]) == 0
    print([k for k in range(123) if ok(k)]) # Michael S. Branicky, Jan 15 2023
    
  • Python
    from itertools import count, islice
    def agen(): # generator of terms
        yield from (i for e in count(0) for f in range(1, 10) for i in range(f*10**e, (f+1)*10**e, f))
    print(list(islice(agen(), 64))) # Michael S. Branicky, Jan 15 2023

Formula

a(n) mod A000030(a(n)) = 0. - Reinhard Zumkeller, Sep 20 2003

Extensions

Definition clarified by Harvey P. Dale, May 01 2023

A045524 Numbers k such that k! has initial digit '5'.

Original entry on oeis.org

7, 21, 38, 46, 61, 66, 81, 119, 137, 144, 150, 165, 189, 196, 206, 209, 221, 224, 235, 243, 248, 253, 258, 279, 292, 340, 342, 353, 362, 383, 413, 429, 440, 488, 508, 529, 540, 584, 597, 611, 630, 651, 662, 679, 685, 704, 711, 718, 725, 732, 764, 782, 812
Offset: 1

Views

Author

Keywords

Comments

n such that A000030(A000142(n)) = 5. - Robert Israel, Feb 07 2017
The asymptotic density of this sequence is log_10(6/5) = 0.079181... (Kunoff, 1987). - Amiram Eldar, Jul 17 2020

Examples

			7 is a term since 7! = 5040 has the initial digit 5.
		

Crossrefs

For factorials with initial digit d (1 <= d <= 9) see A045509, A045510, A045511, A045516, A045517, A045518, A282021, A045519; A045520, A045521, A045522, A045523, A045525, A045526, A045527, A045528, A045529.

Programs

  • Maple
    filter:= proc(t) local tf;
    tf:= t!;
    floor(tf/10^ilog10(tf)) = 5
    end proc:
    select(filter, [$1..1000]); # Robert Israel, Feb 07 2017
  • Mathematica
    Select[ Range[ 850 ], IntegerDigits[ #! ] [[1]] == 5 & ]
  • PARI
    isok(n) = digits(n!)[1] == 5; \\ Michel Marcus, Feb 08 2017

Formula

A008905(a(n)) = 5. - Amiram Eldar, Jul 17 2020

A241299 Initial digit of the decimal expansion of n^(n^n) or n^^3 (in Don Knuth's up-arrow notation).

Original entry on oeis.org

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

Views

Author

Keywords

Comments

0^^3 = 0 since 0^^k = 1 for even k, 0 for odd k, k >= 0.
Conjecture: the distribution of the initial digits obey Zipf's law.
The distribution of the first 1000 terms beginning with 1: 302, 196, 124, 91, 72, 46, 71, 53, 45.

Examples

			a(0) = 0, a(1) = 1, a(2) = 1 because 2^(2^2) = 16, a(3) = 7 because 3^(3^3) = 7625597484987 and its initial digit is 7, etc.
		

Crossrefs

Programs

  • Mathematica
    g[n_] := Quotient[n^p, 10^(Floor[ p*Log10@ n] - (1004 + p))]; f[n_] := Block[{p = n}, Quotient[ Nest[ g@ # &, p, p], 10^(1004 + p)]]; Array[f, 105, 0]

Formula

For n > 0, a(n) = floor(t/10^floor(log_10(t))) where t = n^(n^n).
a(n) = A000030(A002488(n)). - Omar E. Pol, Jul 04 2019

A364185 Leading digit of 11^n.

Original entry on oeis.org

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

Views

Author

Seiichi Manyama, Jul 15 2023

Keywords

Crossrefs

Programs

  • Mathematica
    a[n_] := IntegerDigits[11^n][[1]]; Array[a, 100, 0] (* Amiram Eldar, Jul 15 2023 *)
  • PARI
    a(n) = digits(11^n)[1];

Formula

a(n) = A000030(A001020(n)).

A040997 Absolute value of first digit of n minus sum of other digits of n.

Original entry on oeis.org

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

Views

Author

Keywords

Comments

This is different from |A055017(n)| = |(x1 + x3 + ...) - (x2 + x4 + ...)|, where x1,...,xk are the digits of n. - M. F. Hasler, Nov 09 2019

Examples

			a(371) = |3-7-1| = 5.
		

Crossrefs

Programs

  • Haskell
    a040997 n = abs $ a000030 n - a007953 (a217657 n) -- Reinhard Zumkeller, Oct 10 2012
    
  • PARI
    apply( A040997(n)={abs(vecsum(n=digits(n))-n[1]*2)}, [1..199]) \\ M. F. Hasler, Nov 09 2019

Formula

If decimal expansion of n is x1 x2 ... xk then a(n) = |x1-x2-x3- ... -xk|.
a(n) = abs(A000030(n) - A007953(A217657(n))). - Reinhard Zumkeller, Oct 10 2012

Extensions

Name edited and incorrect formula deleted by M. F. Hasler, Nov 09 2019

A077648 Initial digits of prime numbers.

Original entry on oeis.org

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

Views

Author

Labos Elemer, Nov 19 2002

Keywords

Crossrefs

Programs

  • Magma
    [Intseq(p)[#Intseq(p)]: p in PrimesUpTo(600)]; // Bruno Berselli, Feb 14 2013
    
  • Mathematica
    Table[First[IntegerDigits[Prime[n]]], {n, 1, 120}]
  • PARI
    a(n) = digits(prime(n))[1]; \\ Michel Marcus, Feb 11 2017
    
  • Python
    from sympy import prime
    def A077648(n): return int(str(prime(n))[0]) # Chai Wah Wu, Oct 16 2024

Formula

a(n) = A000030(A000040(n)).

A217398 Numbers starting with 5.

Original entry on oeis.org

5, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542
Offset: 1

Views

Author

Jeremy Gardiner, Oct 02 2012

Keywords

Comments

The lower and upper asymptotic densities of this sequence are 1/45 and 5/27, respectively. - Amiram Eldar, Feb 27 2021
Also numbers such that when the leftmost digit is moved to the unit's place the result is divisible by 5. - Stefano Spezia, Jul 08 2025

Crossrefs

Programs

  • Haskell
    a217398 n = a217398_list !! (n-1)
    a217398_list = filter ((== 5) . a000030) [1..]
    -- Reinhard Zumkeller, Mar 13 2014
    
  • Mathematica
    Select[Range[1000], IntegerDigits[#][[1]] == 5 &] (* T. D. Noe, Oct 02 2012 *)
  • Python
    def A217398(n): return n+(44*10**(len(str(9*n-8))-1))//9 # Chai Wah Wu, Dec 07 2024

Formula

A000030(a(n)) = 5; A143473(a(n)) = a(n). - Reinhard Zumkeller, Mar 13 2014
a(n) = n + (44*10^floor(log_10(9*n-8))-8)/9. - Alan Michael Gómez Calderón, May 17 2023

A367360 Comma transform of squares.

Original entry on oeis.org

1, 14, 49, 91, 62, 53, 64, 96, 48, 11, 1, 11, 41, 91, 62, 52, 62, 93, 43, 14, 4, 14, 45, 95, 66, 56, 67, 97, 48, 19, 9, 11, 41, 91, 61, 51, 61, 91, 41, 11, 1, 11, 41, 91, 62, 52, 62, 92, 42, 12, 2, 12, 42, 92, 63, 53, 63, 93, 43, 13, 3, 13, 43, 94, 64, 54, 64, 94, 44, 14, 5, 15, 45, 95, 65, 55, 65, 96, 46, 16, 6, 16, 46, 97
Offset: 0

Views

Author

N. J. A. Sloane, Nov 22 2023

Keywords

Comments

To compute the comma transform of a sequence [b,c,d,e,f,...], concatenate the last digit of each term with the first digit of the following term. In other words, these are the numbers formed by the pairs of digits that surround the commas that separate the terms of the original sequence.
The comma transform CT(S) of a sequence S of positive numbers maps S into the set F consisting of finite or infinite sequences of positive numbers each with one or two digits. The inverse comma transform CTi maps an element of F to an element of F.
Inspired by Eric Angelini's A121805.

Examples

			The squares are 0, 1, 4, 9, 16, 25, ..., so the comma transform is [0]1, 14, 49, 91, 62, ...
		

Crossrefs

A166499 is the comma transform of the primes, A367361 of the powers of 2, A367362 of the nonnegative integers. See also A368362.

Programs

  • Maple
    Maple code for comma transform (CT(a)) of a sequence a:
    # leading digit, from A000030
    Ldigit:=proc(n) local v; v:=convert(n, base, 10); v[-1]; end;
    CT:=proc(a) local b,i; b:=[];
    for i from 1 to nops(a)-1 do
    b := [op(b), 10*(a[i] mod 10) + Ldigit(a[i+1])]; od: b; end;
    # Inverse comma transform of sequence A calculated in base "bas": - N. J. A. Sloane, Jan 03 2024
    bas := 10;
    Ldigit:=proc(n) local v; v:=convert(n, base, bas); v[-1]; end;
    CTi := proc(A) local B,i,L,R;
    for i from 1 to nops(A) do
       if A[i]>=bas^2 then error("all terms must have 1 or 2 digits"); fi; od:
    B:=Array(1..nops(A),-1);
    if A[1] >= bas then B[1]:= Ldigit(A[1]); L:=(A[1] mod bas);
    else B[1]:=10; L:=A[1];
    fi;
    for i from 2 to nops(A) do
      if A[i] >= bas then R := Ldigit(A[i]) else R:=0; fi;
      B[i] := L*bas + R;
      L := (A[i] mod bas);
    od;
    B;
    end;
    # second Maple program:
    a:= n-> parse(cat(""||(n^2)[-1],""||((n+1)^2)[1])):
    seq(a(n), n=0..99);  # Alois P. Heinz, Nov 22 2023
  • Mathematica
    a[n_]:=FromDigits[{Last[IntegerDigits[n^2]],First[IntegerDigits[(n+1)^2]]}];
    a/@Range[0,83] (* Ivan N. Ianakiev, Nov 24 2023 *)
  • Python
    from itertools import count, islice, pairwise
    def S(): yield from (str(i**2) for i in count(0))
    def agen(): yield from (int(t[-1]+u[0]) for t, u in pairwise(S()))
    print(list(islice(agen(), 84))) # Michael S. Branicky, Nov 22 2023
    
  • Python
    def A367360(n): return (0, 10, 40, 90, 60, 50, 60, 90, 40, 10)[n%10]+int(str((n+1)**2)[0]) # Chai Wah Wu, Dec 22 2023

Formula

a(n) = 10 * A008959(n) + A002993(n+1). - Alois P. Heinz, Nov 22 2023

A002993 Initial digits of squares.

Original entry on oeis.org

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

Views

Author

Keywords

References

  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Programs

Formula

a(n) = A000030(A000290(n)). - Reinhard Zumkeller, Aug 17 2008

A002994 Initial digit of cubes.

Original entry on oeis.org

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

Views

Author

Keywords

Comments

a(n) = A000030(A000578(n)). - Reinhard Zumkeller, Aug 17 2008

References

  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Programs

Previous Showing 11-20 of 197 results. Next