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.

A359384 a(1) = 0. If a(n-1) is a first occurrence, a(n) = A000120(a(n-1)). Otherwise, if a(n-1) is a repeat of a prior terms, a(n) = number of indices j < n such that a(j) = a(n-1).

This page as a plain text file.
%I A359384 #24 Jul 03 2025 23:41:29
%S A359384 0,0,2,1,1,2,2,3,2,4,1,3,2,5,2,6,2,7,3,3,4,2,8,1,4,3,5,2,9,2,10,2,11,
%T A359384 3,6,2,12,2,13,3,7,2,14,3,8,2,15,4,4,5,3,9,2,16,1,5,4,6,3,10,2,17,2,
%U A359384 18,2,19,3,11,2,20,2,21,3,12,2,22,3,13,2,23,4
%N A359384 a(1) = 0. If a(n-1) is a first occurrence, a(n) = A000120(a(n-1)). Otherwise, if a(n-1) is a repeat of a prior terms, a(n) = number of indices j < n such that a(j) = a(n-1).
%C A359384 In other words, a novel term is followed by its binary weight and a repeat term is followed by its cardinality. The sequence is infinite, and all nonzero numbers appear infinitely many times. Zero occurs just twice because it is the only number with zero binary weight. 1 occurs following powers of 2.
%C A359384 a(n) < n.
%H A359384 Michael De Vlieger, <a href="/A359384/b359384.txt">Table of n, a(n) for n = 1..10000</a>
%H A359384 Michael De Vlieger, <a href="/A359384/a359384.png">Log log scatterplot of a(n)</a>, n = 3..2^20.
%H A359384 Michael De Vlieger, <a href="/A359384/a359384_1.png">Log log scatterplot of a(n)</a>, n = 3..2^16, with a color function showing m = A000120(a(n-1)) in black for m = 0, red for m = 1, orange for m = 2, ..., magenta for m = 12.
%e A359384 a(8) = 3, a novel term, therefore a(9) = 2, the binary weight of 3.
%e A359384 a(12) = 3, occurring for the 2nd time, so a(13) = 2.
%t A359384 Block[{a, c, f, k, nn}, nn = 80; c[_] = 0; a[1] = 0; f[n_] := DigitCount[n, 2, 1]; Do[If[c[#] == 0, c[#]++; Set[k, f[#]], c[#]++; Set[k, c[#]]] &[a[n - 1]]; a[n] = k, {n, 2, nn}]; Array[a, nn] ] (* _Michael De Vlieger_, Dec 28 2022 *)
%Y A359384 Cf. A000120, A359369.
%K A359384 nonn
%O A359384 1,3
%A A359384 _David James Sycamore_, Dec 27 2022