cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A258217 Smallest multiple of 7 starting with n, that did not appear earlier.

This page as a plain text file.
%I A258217 #25 Dec 23 2024 14:53:44
%S A258217 14,21,35,42,56,63,7,84,91,105,112,126,133,140,154,161,175,182,196,
%T A258217 203,210,224,231,245,252,266,273,28,294,301,315,322,336,343,350,364,
%U A258217 371,385,392,406,413,420,434,441,455,462,476,483,49,504,511,525,532,546
%N A258217 Smallest multiple of 7 starting with n, that did not appear earlier.
%C A258217 The sequence is a permutation of the positive multiples of 7. - _Vladimir Shevelev_, May 24 2015
%C A258217 A258334(n) = a(n) / 7 is a permutation of the positive integers. - _Reinhard Zumkeller_, May 27 2015
%H A258217 Reinhard Zumkeller, <a href="/A258217/b258217.txt">Table of n, a(n) for n = 1..10000</a>
%H A258217 Éric Angelini, <a href="https://web.archive.org/web/*/http://list.seqfan.eu/oldermail/seqfan/2015-May/014898.html">Multiples of 3 ending with n</a>, SeqFan list, May 23 2015.
%t A258217 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 *)
%o A258217 (Haskell)
%o A258217 import Data.List (isPrefixOf, delete)
%o A258217 a258217 n = a258217_list !! (n-1)
%o A258217 a258217_list = f 1 $ tail $ zip a008589_list $ map show a008589_list where
%o A258217    f x ws = g ws where
%o A258217      g ((u, vs) : uvs) = if isPrefixOf (show x) vs
%o A258217                          then u : f (x + 1) (delete (u, vs) ws) else g uvs
%Y A258217 Cf. A008589, A258188, A258083, A258334.
%K A258217 nonn,base
%O A258217 1,1
%A A258217 _Eric Angelini_ and _Reinhard Zumkeller_, May 23 2015