[go: up one dir, main page]

login
A257946
a(n) is the least number such that the sum of the products of all pairs of consecutive digits is equal to n.
1
10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 25, 219, 26, 419, 27, 35, 28, 819, 29, 1128, 45, 37, 229, 1235, 38, 55, 429, 39, 47, 1146, 56, 1139, 48, 239, 829, 57, 49, 1148, 1247, 439, 58, 1149, 67, 1166, 249, 59, 1158, 1257, 68, 77, 159, 839, 449, 1357, 69, 259, 78, 1177, 1276
OFFSET
0,1
LINKS
Paolo P. Lava and Giovanni Resta, Table of n, a(n) for n = 0..10000 (first 500 terms from Paolo P. Lava)
EXAMPLE
The sum of the products of pairs of consecutive digits of 25 is 2*5 = 10 and 25 is the least number with this property, so a(10) = 25.
The sum of the products of pairs of consecutive digits of 219 is 2*1 + 1*9 = 11. Again, 219 is the least number with this property, so a(11) = 219.
MAPLE
P:=proc(q) local a, b, c, k, j, n; print(10);
for j from 1 to q do for n from 1 to q do a:=n; b:=[];
for k from 1 to ilog10(n)+1 do b:=[(a mod 10), op(b)];
a:=trunc(a/10); od; a:=add(b[k]*b[k+1], k=1..nops(b)-1);
if a=j then print(n); break; fi; od; od; end: P(10^6);
MATHEMATICA
Join[{10}, With[{tbl=Table[{n, Total[Times@@@Partition[ IntegerDigits[ n], 2, 1]]}, {n, 1400}]}, Flatten[Table[Select[tbl, #[[2]]==k&, 1], {k, 60}], 1]][[All, 1]]] (* Harvey P. Dale, Jun 15 2017 *)
PROG
(PARI) a(n)=k=10; while(sum(i=1, #digits(k)-1, digits(k)[i]*digits(k)[i+1])!=n, k++); k
vector(50, n, n--; a(n)) \\ Derek Orr, May 19 2015
CROSSREFS
Sequence in context: A248499 A008716 A011531 * A070839 A161561 A307560
KEYWORD
nonn,base
AUTHOR
Paolo P. Lava, May 14 2015
STATUS
approved