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.

Showing 1-2 of 2 results.

A330648 a(1) = 1 and for any n > 1, if A330647(n) divides a(n-1) then a(n) = a(n-1) / A330647(n), otherwise a(n) = a(n-1) * A330647(n).

Original entry on oeis.org

1, 2, 6, 30, 5, 20, 140, 1260, 126, 1386, 18018, 1287, 10296, 858, 14586, 277134, 12597, 201552, 4635696, 193154, 2897310, 111435, 3120180, 156009, 7429, 133722, 3343050, 96948450, 3231615, 100180065, 3205762080, 94287120, 3488623440, 91805880, 2295147
Offset: 1

Views

Author

Rémy Sigrist, Dec 22 2019

Keywords

Comments

This sequence has similarities with A008336.

Examples

			The first terms, alongside the corresponding A330647(n), are:
  n   a(n)  A330647(n)
  --  ----  ----------
   1     1           1
   2     2           2
   3     6           3
   4    30           5
   5     5           6
   6    20           4
   7   140           7
   8  1260           9
   9   126          10
  10  1386          11
		

Crossrefs

Programs

  • Mathematica
    Nest[Append[#1, Block[{k = 2, s}, While[Nand[FreeQ[#1[[All, 1]], k], MemberQ[{1, k}, Set[s, GCD[#3, k]]]], k++]; {k, If[s == 1, #3 k, #3/k], If[Mod[#3, k] == 0, #3/k, #3 k]}]] & @@ {#, #[[-1, 1]], #[[-1, 2]], #[[-1, -1]]} &, {{1, 1, 1}}, 34][[All, -1]] (* Michael De Vlieger, Dec 23 2019 *)
  • PARI
    x=1; s=0; for (n=1, 35, for (v=1, oo, if (!bittest(s,v), if (gcd(x,v)==1, s+=2^v; x*=v; break, x%v==0, s+=2^v; x/=v; break))); print1 (x", "))

A360706 a(n) is the least positive number not yet used such that its binary representation has either all or none of its 1-bits in common with the XOR of a(1) to a(n-1).

Original entry on oeis.org

1, 2, 3, 4, 8, 12, 5, 10, 6, 9, 7, 16, 17, 24, 14, 11, 18, 20, 13, 15, 19, 32, 36, 21, 25, 26, 22, 23, 27, 33, 37, 28, 34, 30, 29, 40, 42, 31, 64, 96, 35, 68, 38, 44, 41, 43, 39, 48, 56, 45, 65, 66, 46, 47, 67, 80, 52, 49, 57, 50, 82, 69, 97, 51, 53, 60, 54, 55, 58, 72, 73, 59, 61, 76, 70, 71, 74
Offset: 1

Views

Author

Thomas Scheuerle, Feb 17 2023

Keywords

Comments

The lexicographically earliest permutation of positive numbers such that the nim-sum of the first k elements equals the nim-sum of k-1 elements with the element at position k either arithmetically added or subtracted.
The first occurrence of a number m >= 2^k is always m = 2^k.
All positive integers will appear in this sequence: see link section for details.

Examples

			   n    a(n)  a(n) in binary   a(1) XOR ... XOR a(n-1) in binary
------------------------------------------------------------------
   1     1          1b             0b
   2     2         10b             1b
   3     3         11b            11b
   4     4        100b             0b
   5     8       1000b           100b
   6    12       1100b          1100b
   7     5        101b             0b
...
Signed version of this sequence such that the arithmetic sum over the first k values equals the nim-sum over the first k values of the original sequence:
1, 2, -3, 4, 8, -12, 5, 10, -6, -9, 7, 16, -17, 24, -14, 11, -18, 20, -13, ...
		

Crossrefs

Programs

  • MATLAB
    function a = A360706( max_n )
        s = 0; a = []; t = [1:max_n];
        for n = 1:max_n
            k = 1;
            while (t(k) ~= bitand(s,t(k)))&&(0 ~= bitand(s,t(k)))
                k = k+1;
            end
            s = bitxor(s,t(k));
            a(n) = t(k);
            t(k) = max(t)+1; t = sort(t);
        end
    end
    
  • PARI
    { m = s = 0; for (n = 1, 77, for (v = 1, oo, if (!bittest(s, v), x = bitand(m, v); if (x==0 || x==v, s += 2^v; m = bitxor(m, v); print1 (v", "); break;);););); } \\ Rémy Sigrist, Aug 31 2024

Formula

If a(m1) = 2^k and a(m2) = 2^k-1 then m1 - 2^k < 0 and m2 - (2^k-1) > 0 for k > 2.
Showing 1-2 of 2 results.