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.

A099004 First differences of A081145.

This page as a plain text file.
%I A099004 #19 May 22 2025 10:21:35
%S A099004 1,2,3,-4,5,6,-9,7,8,-14,10,11,-18,12,13,-24,15,16,-30,17,19,-34,20,
%T A099004 21,-39,22,23,-43,25,26,-50,27,28,-54,29,31,-57,33,-32,35,36,-70,37,
%U A099004 38,-73,40,41,-78,42,44,-85,45,46,-90,47,48,-94,49,51,-97,52,53,-104,55,56,-109,58,59,-116,61,-60,62,63
%N A099004 First differences of A081145.
%C A099004 Does every number appear in the sequence of absolute values (see A308007)?
%H A099004 Chai Wah Wu, <a href="/A099004/b099004.txt">Table of n, a(n) for n = 1..5000</a>
%t A099004 f[s_] := Block[{k = 1, d = Abs[Most@s - Rest@s], l = Last@s}, While[MemberQ[s, k] || MemberQ[d, Abs[l - k]], k++ ]; Append[s, k]]; t = Nest[f, {1}, 75]; Rest@t - Most@t (* _Robert G. Wilson v_, Jun 13 2006 *)
%o A099004 (Python)
%o A099004 A099004_list, l, s, b1, b2 = [1], 2, 3, set(), set([1])
%o A099004 for n in range(2, 5*10**3+1):
%o A099004     i = s
%o A099004     while True:
%o A099004         m = abs(i-l)
%o A099004         if not (i in b1 or m in b2):
%o A099004             A099004_list.append(i-l)
%o A099004             b1.add(i)
%o A099004             b2.add(m)
%o A099004             l = i
%o A099004             while s in b1:
%o A099004                 b1.remove(s)
%o A099004                 s += 1
%o A099004             break
%o A099004         i += 1 # _Chai Wah Wu_, Dec 15 2014
%Y A099004 Cf. A081145, A081146, A308007, A308021.
%K A099004 sign,easy
%O A099004 1,2
%A A099004 _Amarnath Murthy_ and Meenakshi Srikanth (menakan_s(AT)yahoo.com), Jun 17 2003
%E A099004 Edited by _N. J. A. Sloane_, Apr 08 2006
%E A099004 More terms from _Robert G. Wilson v_, Jun 13 2006