A367338 Comma-successor to n: second term of commas sequence if initial term is n, or -1 if there is no second term.
12, 24, 36, 48, 61, 73, 85, 97, 100, 11, 23, 35, 47, 59, 72, 84, 96, -1, 110, 22, 34, 46, 58, 71, 83, 95, -1, 109, 120, 33, 45, 57, 69, 82, 94, -1, 108, 119, 130, 44, 56, 68, 81, 93, -1, 107, 118, 129, 140, 55, 67, 79, 92, -1, 106, 117, 128, 139, 150, 66, 78, 91, -1, 105, 116
Offset: 1
Examples
a(1) = A121803(2) = 12, a(2) = A139284(2) = 24, a(3) = 36, since the full commas sequence starting with 3 is [3, 36] (which also implies a(36) = -1), a(4) = A366492(2) = 48, and so on. 60 is the first number that is a comma-child (a member of A367312) but is missing from the present sequence (it is a comma-child but not a comma-successor, since it loses out to 59).
Links
- Michael S. Branicky, Table of n, a(n) for n = 1..10000
- Eric Angelini, Michael S. Branicky, Giovanni Resta, N. J. A. Sloane, and David W. Wilson, The Comma Sequence: A Simple Sequence With Bizarre Properties, arXiv:2401.14346, Fibonacci Quarterly 62:3 (2024), 215-232.
- Eric Angelini, Michael S. Branicky, Giovanni Resta, N. J. A. Sloane, and David W. Wilson, The Comma Sequence: A Simple Sequence With Bizarre Properties, Local copy.
- N. J. A. Sloane, Eric Angelini's Comma Sequence, Experimental Math Seminar, Rutgers Univ., January 18, 2024, Youtube video; Slides
Crossrefs
Programs
-
Maple
Ldigit:=proc(n) local v; v:=convert(n, base, 10); v[-1]; end; A367338 := proc(n) local f,i,d; f := (n mod 10); d:=10*f; for i from 1 to 9 do d := d+1; if Ldigit(n+d) = i then return(n+d); fi; od: return(-1); end; for n from 1 to 50 do lprint(n, A367338(n)); od: # N. J. A. Sloane, Dec 06 2023
-
Mathematica
a[n_] := a[n] = Module[{l = n, y = 1, d}, While[y < 10, l = l + 10*(Mod[l, 10]); y = 1; While[y < 10, d = IntegerDigits[l + y][[1]]; If[d == y, l = l + y; Break[];]; y++;]; If[y < 10, Return[l]];]; Return[-1];]; Table[a[n], {n, 1, 65}] (* Robert P. P. McKone, Dec 18 2023 *)
-
Python
from itertools import islice def a(n): an, y = n, 1 while y < 10: an, y = an + 10*(an%10), 1 while y < 10: if str(an+y)[0] == str(y): an += y break y += 1 if y < 10: return an return -1 print([a(n) for n in range(1, 66)]) # Michael S. Branicky, Nov 15 2023
Comments