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.

A367188 a(1) = 1, thereafter a(n) = a(n-1) - A007504(n-1) if positive and novel, else a(n-1) + A007504(n-1).

This page as a plain text file.
%I A367188 #28 Jun 21 2025 01:56:44
%S A367188 1,3,8,18,35,7,48,106,29,129,258,98,295,57,338,10,391,831,330,898,259,
%T A367188 971,180,1054,91,1151,2312,1048,2419,939,2532,812,2663,675,2802,526,
%U A367188 2953,369,3116,202,3289,23,3470,7108,3277,7305,3078,7516,2855,7743,2626,7976
%N A367188 a(1) = 1, thereafter a(n) = a(n-1) - A007504(n-1) if positive and novel, else a(n-1) + A007504(n-1).
%C A367188 A variation on Cald's sequence A006509.
%H A367188 Michael De Vlieger, <a href="/A367188/b367188.txt">Table of n, a(n) for n = 1..10000</a>
%H A367188 Michael De Vlieger, <a href="/A367188/a367188.png">Log log scatterplot of a(n)</a>, n = 1..2^20.
%e A367188 a(1)-A007504(1) = 1-2, negative so a(2) = 1+2 = 3.
%e A367188 a(2)-A007504(2) = 3-5, negative so a(3) = 3+5 = 8.
%e A367188 a(3)-A007504(3) = 8-10, negative so a(4) = 8+10 =18.
%e A367188 a(4)-A007504(4) = 18-17 = 1 (positive but seen before at a(1)), so a(5) = 35.
%e A367188 a(5)-A007504(5) = 35-28 = 7, positive and novel so a(6) = 7.
%e A367188 a(10)-A007504(10) = 129-129 = 0, therefore a(11) = 2*129 = 258.
%t A367188 nn = 120; c[_] := False; a[1] = j = 1; c[1] = True; s = 2;
%t A367188 Do[If[Or[# < 1, c[#]], Set[k, j + s], Set[k, #]] &[j - s];
%t A367188   s += Prime[n];
%t A367188   Set[{a[n], j, c[k]}, {k, k, True}], {n, 2, nn}];
%t A367188 Array[a, nn] (* _Michael De Vlieger_, Nov 10 2023 *)
%Y A367188 Cf. A000040, A006509, A007504.
%K A367188 nonn
%O A367188 1,2
%A A367188 _David James Sycamore_, Nov 10 2023
%E A367188 More terms from _Michael De Vlieger_, Nov 10 2023