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.

A000042 Unary representation of natural numbers.

This page as a plain text file.
%I A000042 M4804 #117 May 23 2025 11:01:49
%S A000042 1,11,111,1111,11111,111111,1111111,11111111,111111111,1111111111,
%T A000042 11111111111,111111111111,1111111111111,11111111111111,
%U A000042 111111111111111,1111111111111111,11111111111111111,111111111111111111,1111111111111111111,11111111111111111111
%N A000042 Unary representation of natural numbers.
%C A000042 Or, numbers written in base 1.
%C A000042 If p is a prime > 5 then d_{a(p)} == 1 (mod p) where d_{a(p)} is a divisor of a(p). This also gives an alternate elementary proof of the infinitude of prime numbers by the fact that for every prime p there exists at least one prime of the form k*p + 1. - _Amarnath Murthy_, Oct 05 2002
%C A000042 11 = 1*9 + 2; 111 = 12*9 + 3; 1111 = 123*9 + 4; 11111 = 1234*9 + 5; 111111 = 12345*9 + 6; 1111111 = 123456*9 + 7; 11111111 = 1234567*9 + 8; 111111111 = 12345678*9 + 9. - _Vincenzo Librandi_, Jul 18 2010
%D A000042 Albert H. Beiler, Recreations in the theory of numbers, New York, Dover, (2nd ed.) 1966. See pp. 57-58.
%D A000042 K. G. Kroeber, Mathematik der Palindrome; p. 348; 2003; ISBN 3 499 615762; Rowohlt Verlag; Germany.
%D A000042 D. Olivastro, Ancient Puzzles. Bantam Books, NY, 1993, p. 276.
%D A000042 Alfred S. Posamentier, Math Charmers, Tantalizing Tidbits for the Mind, Prometheus Books, NY, 2003, page 32.
%D A000042 N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
%H A000042 David Wasserman, <a href="/A000042/b000042.txt">Table of n, a(n) for n = 1..1000</a>
%H A000042 Makoto Kamada, <a href="https://stdkmd.net/nrr/repunit">Factorizations of 11...11 (Repunit)</a>.
%H A000042 Amarnath Murthy, <a href="http://fs.gallup.unm.edu/SNJ11.pdf">On the divisors of Smarandache Unary Sequence</a>. Smarandache Notions Journal, Vol. 11, No. 1-2-3, Spring 2000, page 184.
%H A000042 Amarnath Murthy and Charles Ashbacher, <a href="https://archive.org/details/MurthyBook">Generalized Partitions and Some New Ideas on Number Theory and Smarandache Sequences</a>, Hexis, Phoenix; USA 2005. See Section 2.12.
%H A000042 <a href="/index/Rec#order_02">Index entries for linear recurrences with constant coefficients</a>, signature (11,-10).
%H A000042 <a href="/index/Di#divseq">Index to divisibility sequences</a>
%F A000042 a(n) = (10^n - 1)/9.
%F A000042 G.f.: 1/((1-x)*(1-10*x)).
%F A000042 Binomial transform of A003952. - _Paul Barry_, Jan 29 2004
%F A000042 From _Paul Barry_, Aug 24 2004: (Start)
%F A000042 a(n) = 10*a(n-1) + 1, n > 1, a(1)=1. [Offset 1.]
%F A000042 a(n) = Sum_{k=0..n} binomial(n+1, k+1)*9^k. [Offset 0.] (End)
%F A000042 a(2n) - 2*a(n) = (3*a(n))^2. - _Amarnath Murthy_, Jul 21 2003
%F A000042 a(n) is the binary representation of the n-th Mersenne number (A000225). - _Ross La Haye_, Sep 13 2003
%F A000042 The Hankel transform of this sequence is [1,-10,0,0,0,0,0,0,0,0,...]. - _Philippe Deléham_, Nov 21 2007
%F A000042 E.g.f.: (exp(10*x) - exp(x))/9. - _G. C. Greubel_, Nov 04 2018
%F A000042 a(n) = 11*a(n-1) - 10*a(n-2). - _Wesley Ivan Hurt_, May 28 2021
%F A000042 a(n+m-2) = a(m)*a(n-1) - (a(m)-1)*a(n-2), n>1, m>0. - _Matej Veselovac_, Jun 07 2021
%F A000042 Sum_{n>=1} 1/a(n) = A065444. - _Stefano Spezia_, Jul 30 2024
%p A000042 a:= n-> parse(cat(1$n)):
%p A000042 seq(a(n), n=1..25);  # _Alois P. Heinz_, Mar 23 2018
%t A000042 Table[(10^n - 1)/9, {n, 1, 18}]
%t A000042 FromDigits/@Table[PadLeft[{},n,1],{n,20}] (* _Harvey P. Dale_, Aug 21 2011 *)
%o A000042 (PARI) a(n)=if(n<0,0,(10^n-1)/9)
%o A000042 (Sage) [gaussian_binomial(n, 1, 10) for n in range(1, 19)]  # _Zerinvary Lajos_, May 28 2009
%o A000042 (Haskell) A000042 n = (10^n-1) `div` 9 -- _James Spahlinger_, Oct 08 2012
%o A000042 (Common Lisp) (defun a000042 (n) (truncate (expt 10 n) 9)) ; _James Spahlinger_, Oct 12 2012
%o A000042 (Magma) [(10^n - 1)/9: n in [1..20]]; // _G. C. Greubel_, Nov 04 2018
%o A000042 (Python) def a(n): return int("1"*n) # _Michael S. Branicky_, Jan 01 2021
%Y A000042 Cf. A002275, A007088, A007089, A007090, A007091, A007092, A007093, A007094, A007095, A007908, A065444.
%K A000042 base,easy,nonn,nice
%O A000042 1,2
%A A000042 _N. J. A. Sloane_
%E A000042 More terms from _Paul Barry_, Jan 29 2004