OFFSET
1,1
COMMENTS
The sequence is a permutation of the positive multiples of 7. - Vladimir Shevelev, May 24 2015
A258334(n) = a(n) / 7 is a permutation of the positive integers. - Reinhard Zumkeller, May 27 2015
LINKS
Reinhard Zumkeller, Table of n, a(n) for n = 1..10000
Éric Angelini, Multiples of 3 ending with n, SeqFan list, May 23 2015.
MATHEMATICA
a[1] = 14; a[n_] := a[n] = For[dn = IntegerDigits[n]; k = 7, True, k = k+7, dk = IntegerDigits[k]; lg = Min[Length[dn], Length[dk]]; If[Union[ Take[dk, lg] - Take[dn, lg]] == {0} && FreeQ[Array[a, n-1], k], Return[k]]]; Array[a, 54] (* Jean-François Alcover, Feb 09 2018 *)
PROG
(Haskell)
import Data.List (isPrefixOf, delete)
a258217 n = a258217_list !! (n-1)
a258217_list = f 1 $ tail $ zip a008589_list $ map show a008589_list where
f x ws = g ws where
g ((u, vs) : uvs) = if isPrefixOf (show x) vs
then u : f (x + 1) (delete (u, vs) ws) else g uvs
CROSSREFS
KEYWORD
nonn,base,changed
AUTHOR
Eric Angelini and Reinhard Zumkeller, May 23 2015
STATUS
approved