%I M4804 #113 Jul 31 2024 01:36:55
%S 1,11,111,1111,11111,111111,1111111,11111111,111111111,1111111111,
%T 11111111111,111111111111,1111111111111,11111111111111,
%U 111111111111111,1111111111111111,11111111111111111,111111111111111111,1111111111111111111,11111111111111111111
%N Unary representation of natural numbers.
%C Or, numbers written in base 1.
%C 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 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 Albert H. Beiler, Recreations in the theory of numbers, New York, Dover, (2nd ed.) 1966. See pp. 57-58.
%D K. G. Kroeber, Mathematik der Palindrome; p. 348; 2003; ISBN 3 499 615762; Rowohlt Verlag; Germany.
%D D. Olivastro, Ancient Puzzles. Bantam Books, NY, 1993, p. 276.
%D N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
%H David Wasserman, <a href="/A000042/b000042.txt">Table of n, a(n) for n = 1..1000</a>
%H Makoto Kamada, <a href="https://stdkmd.net/nrr/repunit">Factorizations of 11...11 (Repunit)</a>.
%H 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 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 <a href="/index/Rec#order_02">Index entries for linear recurrences with constant coefficients</a>, signature (11,-10).
%H <a href="/index/Di#divseq">Index to divisibility sequences</a>
%F a(n) = (10^n - 1)/9.
%F G.f.: 1/((1-x)*(1-10*x)).
%F Binomial transform of A003952. - _Paul Barry_, Jan 29 2004
%F From _Paul Barry_, Aug 24 2004: (Start)
%F a(n) = 10*a(n-1) + 1, n > 1, a(1)=1. [Offset 1.]
%F a(n) = Sum_{k=0..n} binomial(n+1, k+1)*9^k. [Offset 0.] (End)
%F a(2n) - 2*a(n) = (3*a(n))^2. - _Amarnath Murthy_, Jul 21 2003
%F a(n) is the binary representation of the n-th Mersenne number (A000225). - _Ross La Haye_, Sep 13 2003
%F The Hankel transform of this sequence is [1,-10,0,0,0,0,0,0,0,0,...]. - _Philippe Deléham_, Nov 21 2007
%F E.g.f.: (exp(10*x) - exp(x))/9. - _G. C. Greubel_, Nov 04 2018
%F a(n) = 11*a(n-1) - 10*a(n-2). - _Wesley Ivan Hurt_, May 28 2021
%F 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 Sum_{n>=1} 1/a(n) = A065444. - _Stefano Spezia_, Jul 30 2024
%p a:= n-> parse(cat(1$n)):
%p seq(a(n), n=1..25); # _Alois P. Heinz_, Mar 23 2018
%t Table[(10^n - 1)/9, {n, 1, 18}]
%t FromDigits/@Table[PadLeft[{},n,1],{n,20}] (* _Harvey P. Dale_, Aug 21 2011 *)
%o (PARI) a(n)=if(n<0,0,(10^n-1)/9)
%o (Sage) [gaussian_binomial(n, 1, 10) for n in range(1, 19)] # _Zerinvary Lajos_, May 28 2009
%o (Haskell) A000042 n = (10^n-1) `div` 9 -- _James Spahlinger_, Oct 08 2012
%o (Common Lisp) (defun a000042 (n) (truncate (expt 10 n) 9)) ; _James Spahlinger_, Oct 12 2012
%o (Magma) [(10^n - 1)/9: n in [1..20]]; // _G. C. Greubel_, Nov 04 2018
%o (Python) def a(n): return int("1"*n) # _Michael S. Branicky_, Jan 01 2021
%Y Cf. A002275, A007088, A007089, A007090, A007091, A007092, A007093, A007094, A007095, A007908, A065444.
%K base,easy,nonn,nice
%O 1,2
%A _N. J. A. Sloane_
%E More terms from _Paul Barry_, Jan 29 2004