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.

A371985 For n a power of 2, a(n) = n. Otherwise a(n) is the smallest novel multiple of a(n - 2^m), where 2^m is the greatest power of 2 not exceeding n.

This page as a plain text file.
%I A371985 #20 Apr 16 2024 13:52:42
%S A371985 1,2,3,4,5,6,9,8,7,10,12,20,15,18,27,16,11,14,21,24,25,30,36,40,28,50,
%T A371985 48,60,45,54,81,32,13,22,33,44,35,42,63,56,49,70,72,80,75,90,108,96,
%U A371985 55,84,105,120,100,150,144,160,112,200,192,180,135,162,243,64,17
%N A371985 For n a power of 2, a(n) = n. Otherwise a(n) is the smallest novel multiple of a(n - 2^m), where 2^m is the greatest power of 2 not exceeding n.
%C A371985 Reminiscent of the Doudna sequence A005940; also of A052330 and A269848.
%C A371985 All powers of 2 (a(n) = n) are assigned first in order to avoid the second part of the definition giving a(n) = 2^k for some n which is not a power of 2 (see Example for a(12) = 20).
%C A371985 It follows from the definition that all powers of 2, all primes and all multiples of all primes are terms so this sequence is a permutation of the positive integers (A000027), with primes in order.
%C A371985 Each prime power appears before any of its multiples, meaning that this sequence has "property S" as defined in A368900.
%H A371985 Michael De Vlieger, <a href="/A371985/b371985.txt">Table of n, a(n) for n = 1..16384</a>
%H A371985 David A. Corneth, <a href="/A371985/a371985.gp.txt">PARI program</a>
%H A371985 Michael De Vlieger, <a href="/A371985/a371985_1.png">Log log scatterplot of a(n)</a>, n = 1..2^20.
%H A371985 Michael De Vlieger, <a href="/A371985/a371985.png">Fan style binary tree showing a(n)</a>, n = 1..8192, with a color function showing primes in red, perfect prime powers in gold, squarefree composites in green, and numbers neither squarefree nor prime powers in blue or purple. Purple represents powerful numbers that are not prime powers.
%H A371985 <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a>
%F A371985 a(2^k + 1) = prime(k+1).
%e A371985 a(3) = 3, because 2 is the greatest power of 2 not exceeding 3 and 3-2 = 1, so a(3) = 3, the least novel multiple of a(1) = 1.
%e A371985 a(12) is the smallest novel multiple of a(12-8) = a(4) = 4, and at this point in the sequence 4,8,12 are all prior terms and a(16) = 16 is already taken, so a(12) = 20.
%t A371985 nn = 10; c[_] := False; m[_] := 1; a[1] = 1; c[1] = True;
%t A371985 Do[If[i == 0,
%t A371985    k = 2^j + i,
%t A371985    (While[Set[k, m[#] #]; Or[c[k], IntegerQ@ Log2[k]], m[#]++]) &@ a[i]];
%t A371985   Set[{a[2^j + i], c[k]}, {k, True}], {j, nn}, {i, 0, 2^j - 1}];
%t A371985 Array[a, 2^(nn + 1) - 1] (* _Michael De Vlieger_, Apr 15 2024 *)
%o A371985 (PARI) \\ See PARI link
%Y A371985 Cf. A000027, A005940, A052330, A269848, A368900.
%K A371985 nonn
%O A371985 1,2
%A A371985 _David James Sycamore_, Apr 15 2024