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.

A380434 Lexicographically earliest sequence of distinct positive integers such that for any n > 0, the initial digit of n divides a(n) or the initial digit of a(n) divides n.

This page as a plain text file.
%I A380434 #10 Jan 27 2025 09:58:59
%S A380434 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,22,21,24,23,26,25,
%T A380434 28,27,30,29,33,36,31,39,42,32,45,48,34,40,44,35,52,41,37,56,60,38,64,
%U A380434 50,55,43,65,61,51,46,70,75,80,47,54,66,71,49,53,62,72
%N A380434 Lexicographically earliest sequence of distinct positive integers such that for any n > 0, the initial digit of n divides a(n) or the initial digit of a(n) divides n.
%C A380434 This sequence is a self-inverse permutation of the positive integers.
%H A380434 Rémy Sigrist, <a href="/A380434/b380434.txt">Table of n, a(n) for n = 1..12000</a>
%H A380434 Rémy Sigrist, <a href="/A380434/a380434.png">Scatterplot of the first 120000 terms</a>
%H A380434 Rémy Sigrist, <a href="/A380434/a380434.gp.txt">PARI program</a>
%H A380434 <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a>
%o A380434 (PARI) \\ See Links section.
%o A380434 (Python)
%o A380434 from itertools import count, islice
%o A380434 def agen(): # generator of terms
%o A380434     aset, m = set(), 1
%o A380434     for n in count(1):
%o A380434         n1 = int(str(n)[0])
%o A380434         an = next(k for k in count(m) if k not in aset and (k%n1 == 0 or n%int(str(k)[0]) == 0))
%o A380434         yield an
%o A380434         aset.add(an)
%o A380434         while m in aset: m += 1
%o A380434 print(list(islice(agen(), 67))) # _Michael S. Branicky_, Jan 27 2025
%Y A380434 Cf. A000030, A375758.
%K A380434 nonn,base
%O A380434 1,2
%A A380434 _Rémy Sigrist_, Jan 24 2025