OFFSET
1,3
COMMENTS
Supoose n is the k-digit number d_1 d_2 ... d_k. Form a graph with k nodes labeled 1, 2, ..., k. Join node i to node j by a directed edge whenever |j-i| = 1 + d_i. Then n is a stringed number iff the graph has a Hamiltonian path.
Single-digit numbers are trivially stringed.
REFERENCES
Eric Angelini, Posting to Sequence Fans Mailing List, Jul 10 2014; with additional comments from Robert Israel.
LINKS
Lars Blomberg, Table of n, a(n) for n = 1..10001
EXAMPLE
If n = 2014 the graph has nodes 1,2,3,4 with edges 1->4 (since 4-1=d_1+1=3), 2->1 (since 2-1=d_2+1=1), 2->3 (since 3-2=d_2+1=1), 3->1 (since 3-1=d_3+1=2) , and there is a Hamiltonian path 2->3->1->4, so 2014 is stringed.
MAPLE
Stringed:= proc(n)
uses GraphTheory;
local L, G, E, d;
L:= convert(n, base, 10);
d:= nops(L);
E:= select(e -> e[2] <= d and e[2] >= 1, {seq(seq([i, i+s*(1+L[i])], s=[1, -1]), i=1..d)})
union {seq([0, i], i=1..d)} union {seq([i, 0], i=1..d)};;
G:= Digraph([$0..d], E);
IsHamiltonian(G);
end proc;
select(Stringed, {$0..2020});
# Robert Israel, Jul 10 2014
CROSSREFS
KEYWORD
nonn,base
AUTHOR
N. J. A. Sloane, Jul 13 2014
EXTENSIONS
Corrected and extended by Robert Israel, Jul 10 2014
STATUS
approved