The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A285470 Numbers k where "2" appears as the second digit of the decimal representation. 1
12, 22, 32, 42, 52, 62, 72, 82, 92, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 620, 621, 622, 623, 624, 625, 626, 627 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
COMMENTS
To find a(n), concatenate the first digit of n with 2 and then the other digits (if any) from n. See example. - David A. Corneth, Jun 12 2017
LINKS
FORMULA
From Robert Israel, Jun 12 2017: (Start)
a(10*n+j) = 10*a(n)+j for 0<=j<=9 and n >= 1.
G.f. g(x) satisfies g(x) = 10*(1-x^10)*g(x^10)/(1-x) + (x + 2*x + ... + 9*x^9)*x^10/(1-x^10) + 12*x + 22*x^2 + ... + 92*x^9. (End)
EXAMPLE
a(21) = 221, a(36) = 326.
As the first digit of 983 is 9, and the others are 83, a(983) = 9283. - David A. Corneth, Jun 12 2017
MAPLE
seq(seq(seq(a*10^d + 2*10^(d-1)+c, c=0..10^(d-1)-1), a=1..9), d=1..2); # Robert Israel, Jun 12 2017
MATHEMATICA
Table[FromDigits@ Apply[Join, {{First@ #}, {2}, Rest@ #}] &@ IntegerDigits@ n, {n, 67}] (* Michael De Vlieger, Jun 12 2017 *)
PROG
(PARI) isok(n) = (n>9) && digits(n)[2] == 2; \\ Michel Marcus, Jun 12 2017
(PARI) a(n) = my(d = digits(n)); fromdigits(concat([d[1], [2], vector(#d-1, i, d[i+1])])) \\ David A. Corneth, Jun 12 2017
(PARI) nxt(n) = {if(isok(n+1), n+1, d = digits(n); t = 9*10^(#d-2); if(d[1]==9, t*=3); n+=t++) \\ David A. Corneth, Jun 12 2017
(Python)
def a(n): s = str(n); return int(s[0] + "2" + s[1:])
print([a(n) for n in range(1, 68)]) # Michael S. Branicky, Dec 22 2021
CROSSREFS
Cf. A011532 (containing 2), A052404 (without 2), A217394 (starting with 2).
Sequence in context: A286094 A348187 A098955 * A124885 A115745 A129639
KEYWORD
nonn,base,easy
AUTHOR
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified June 8 17:25 EDT 2024. Contains 373224 sequences. (Running on oeis4.)