A062273 a(n) is an n-digit number with digits in increasing order with 0 following 9 and this is maintained in the concatenation of any number of consecutive terms.
1, 23, 456, 7890, 12345, 678901, 2345678, 90123456, 789012345, 6789012345, 67890123456, 789012345678, 9012345678901, 23456789012345, 678901234567890, 1234567890123456, 78901234567890123, 456789012345678901, 2345678901234567890, 12345678901234567890
Offset: 1
Examples
a(5) = 12345 as a(4) is 7890.
Links
- Robert Israel, Table of n, a(n) for n = 1..999
Programs
-
Maple
f:= proc(n) option remember: local d,t,k; d:= procname(n-1) mod 10; t:= 0: for k from 1 to n do d:= d+1 mod 10; t:= t + d*10^(n-k) od: t end proc: f(1):= 1: map(f, [$1..30]); # Robert Israel, Apr 02 2018
-
Mathematica
FromDigits/@Table[Take[PadRight[{},250,Join[Range[9],{0}]],{(n(n+1))/2+ 1,((n+1)(n+2))/2}],{n,0,20}] (* Harvey P. Dale, May 15 2015 *)
-
PARI
a(n) = sum(i=1, n, ((n*(n-1)/2+i) % 10)*10^(n-i)); \\ Michel Marcus, May 26 2022
-
Python
def a(n): return sum((n*(n-1)//2+i)%10*10**(n-i) for i in range(1, n+1)) print([a(n) for n in range(1, 21)]) # Michael S. Branicky, May 26 2022 after Michel Marcus
Formula
From Carl R. White, Oct 21 2009: (Start)
a(n) = floor( 10^(10*ceiling(n/10) + (n*(n+1)/2 mod 10)) * 1234567890/9999999999 ) mod 10^n.
The generalized form g, for any integer base b (>2), is: g(b,n) = floor( b^(b*ceiling(n/b) + (n*(n+1)/2 mod b)) * floor( b^(b+1)/(b-1)^2 - (b+1) ) / (b^b-1)) mod b^n, so here a(n) = g(10,n). (End)
a(n) = Sum_{i=1..n} ((n*(n-1)/2+i) mod 10)*10^(n-i). - Vedran Glisic, Apr 08 2011
Extensions
More terms from Larry Reeves (larryr(AT)acm.org), Jun 18 2001
Comments