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-10 of 11 results. Next

A000030 Initial digit of n.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 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, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
Offset: 0

Views

Author

Keywords

Comments

When n - a(n)*10^[log_10 n] >= 10^[(log_10 n) - 1], where [] denotes floor, or when n < 100 and 10|n, n is the concatenation of a(n) and A217657(n). - Reinhard Zumkeller, Oct 10 2012, improved by M. F. Hasler, Nov 17 2018, and corrected by Glen Whitney, Jul 01 2022
Equivalent definition: The initial a(0) = 0 is followed by each digit in S = {1,...,9} once. Thereafter, repeat 10 times each digit in S. Then, repeat 100 times each digit in S, etc.

Examples

			23 begins with a 2, so a(23) = 2.
		

References

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

Crossrefs

Programs

  • Haskell
    a000030 = until (< 10) (`div` 10) -- Reinhard Zumkeller, Feb 20 2012, Feb 11 2011
    
  • Magma
    [Intseq(n)[#Intseq(n)]: n in [1..100]]; // Vincenzo Librandi, Nov 17 2018
    
  • Maple
    A000030 := proc(n)
        if n = 0 then
            0;
        else
            convert(n,base,10) ;
            %[-1] ;
        end if;
    end proc:
    seq(A000030(n),n=0..200) ;# N. J. A. Sloane, Feb 10 2017
  • Mathematica
    Join[{0},First[IntegerDigits[#]]&/@Range[90]] (* Harvey P. Dale, Mar 01 2011 *)
    Table[Floor[n/10^(Floor[Log10[n]])], {n, 1, 50}] (* G. C. Greubel, May 16 2017 *)
    Table[NumberDigit[n,IntegerLength[n]-1],{n,0,100}] (* Harvey P. Dale, Aug 29 2021 *)
  • PARI
    a(n)=if(n<10,n,a(n\10)) \\ Mainly for illustration.
    
  • PARI
    A000030(n)=n\10^logint(n+!n,10) \\ Twice as fast as a(n)=digits(n)[1]. Before digits() was added in PARI v.2.6.0 (2013), one could use, e.g., Vecsmall(Str(n))[1]-48. - M. F. Hasler, Nov 17 2018
    
  • Python
    def a(n): return int(str(n)[0])
    print([a(n) for n in range(85)]) # Michael S. Branicky, Jul 01 2022

Formula

a(n) = [n / 10^([log_10(n)])] where [] denotes floor and log_10(n) is the logarithm is base 10. - Dan Fux (dan.fux(AT)OpenGaia.com or danfux(AT)OpenGaia.com), Apr 07 2001
a(n) = k for k*10^j <= n < (k+1)*10^j for some j. - M. F. Hasler, Mar 23 2015

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

A097408 Initial decimal digit of n^4.

Original entry on oeis.org

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

Views

Author

Eric W. Weisstein, Aug 16 2004

Keywords

Examples

			1, 16, 81, 256, 625, 1296, 2401, 4096, 6561, 10000, ...
		

Crossrefs

Programs

  • Maple
    a:= n-> parse(""||(n^4)[1]):
    seq(a(n), n=1..120);  # Alois P. Heinz, Jan 28 2016

A097409 Initial decimal digit of n^5.

Original entry on oeis.org

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

Views

Author

Eric W. Weisstein, Aug 16 2004

Keywords

Examples

			1, 32, 243, 1024, 3125, 7776, 16807, 32768, 59049, 100000, ...
		

Crossrefs

Programs

  • Maple
    a:= n-> parse(""||(n^5)[1]):
    seq(a(n), n=1..120);  # Alois P. Heinz, Jan 28 2016

A097413 Initial decimal digit of n^9.

Original entry on oeis.org

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

Views

Author

Eric W. Weisstein, Aug 16 2004

Keywords

Examples

			1, 512, 19683, 262144, 1953125, 10077696, 40353607, 134217728, 387420489, 1000000000, ...
		

Crossrefs

Programs

  • Maple
    idd:= n -> floor(n/10^ilog10(n)):
    seq(idd(n^9),n=2..100); # Robert Israel, Jan 28 2016
  • Mathematica
    Table[IntegerDigits[n^9][[1]],{n,120}] (* Harvey P. Dale, Aug 25 2023 *)

Formula

a(n) = A000030(n^9) = floor(n^9/10^A004216(n^9)). - Robert Israel, Jan 28 2016

A097410 Initial decimal digit of n^6.

Original entry on oeis.org

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

Views

Author

Eric W. Weisstein, Aug 16 2004

Keywords

Examples

			1, 64, 729, 4096, 15625, 46656, 117649, 262144, 531441, 1000000, ...
		

Crossrefs

Programs

  • Mathematica
    IntegerDigits[#][[1]]&/@(Range[110]^6) (* Harvey P. Dale, Mar 23 2018 *)

Extensions

One prepended by Harvey P. Dale, Mar 23 2018

A097411 Initial decimal digit of n^7.

Original entry on oeis.org

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

Views

Author

Eric W. Weisstein, Aug 16 2004

Keywords

Examples

			1, 128, 2187, 16384, 78125, 279936, 823543, 2097152, 4782969, 10000000, ...
		

Crossrefs

Programs

  • Mathematica
    Table[First[IntegerDigits[n^7]],{n,110}] (* Harvey P. Dale, Mar 17 2019 *)

Extensions

1 prepended by Harvey P. Dale, Mar 17 2019

A097412 Initial decimal digit of n^8.

Original entry on oeis.org

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

Views

Author

Eric W. Weisstein, Aug 16 2004

Keywords

Examples

			1, 256, 6561, 65536, 390625, 1679616, 5764801, 16777216, 43046721, 100000000, ...
		

Crossrefs

Extensions

a(0) and a(1) added by Neven Juric, Sep 23 2010

A097414 Initial decimal digit of n^10.

Original entry on oeis.org

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

Views

Author

Eric W. Weisstein, Aug 16 2004

Keywords

Examples

			1, 1024, 59049, 1048576, 9765625, 60466176, 282475249, 1073741824, 3486784401, 10000000000, ...
		

Crossrefs

Programs

  • Mathematica
    IntegerDigits[#][[1]]&/@(Range[120]^10) (* Harvey P. Dale, Jan 12 2024 *)

Extensions

a(1) inserted by Pontus von Brömssen, Jul 02 2021

A144582 Numbers having the same leading decimal digit as their cube.

Original entry on oeis.org

0, 1, 10, 11, 12, 28, 29, 32, 33, 34, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287
Offset: 1

Views

Author

Reinhard Zumkeller, Aug 17 2008

Keywords

Comments

For k > 0, write k = s * 10^t, 1 <= s < 10, then k is a term if and only if s is in [1, 2^(1/3)) U (20^(1/3), 3) U (30^(1/3), 40^(1/3)) U (30^(2/3), 10). - Jianing Song, Dec 26 2022

Examples

			a(13)=99 and 970299=99^3 start both with 9.
		

Crossrefs

Cf. A000030, A002994, A000578, A089951, A256523 (subsequence).

Programs

  • Haskell
    a144582 n = a144582_list !! (n-1)
    a144582_list = [x | x <- [0..], a000030 x == a000030 (x ^ 3)]
    -- Reinhard Zumkeller, Apr 01 2015
  • Mathematica
    Select[Range[0,300],First[IntegerDigits[#]]== First[IntegerDigits[#^3]]&]  (* Harvey P. Dale, Mar 14 2011 *)
  • PARI
    isok(n) = (n == 0) || (digits(n)[1] == digits(n^3)[1]); \\ Michel Marcus, Mar 18 2015
    

Formula

A000030(a(n)) = A002994(a(n)) = A000030(A000578(a(n))).
Showing 1-10 of 11 results. Next