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.

Previous Showing 51-58 of 58 results.

A303449 Denominator of (2*n+1)/(2^(2*n+1)-1).

Original entry on oeis.org

1, 7, 31, 127, 511, 2047, 8191, 32767, 131071, 524287, 299593, 8388607, 33554431, 134217727, 536870911, 2147483647, 8589934591, 34359738367, 137438953471, 549755813887, 2199023255551, 8796093022207, 35184372088831, 140737488355327, 562949953421311, 2251799813685247
Offset: 0

Views

Author

Altug Alkan, Apr 24 2018

Keywords

Comments

If A160145(n) = 0, then a(n) = A083420(n).
Least values of k such that a(k) = A083420(k)/A036259(n) are 0, 10, 126, 77, 540, 73, 1242, 328, 1540, 489 for 1 <= n <= 10.

Crossrefs

Cf. A005408, A036259, A083420, A160144 (numerators), A160145.

Programs

  • Maple
    seq(denom((2*n+1)/(2^(2*n+1)-1)), n=0..25);
  • PARI
    a(n) = denominator((2*n+1)/(2^(2*n+1)-1));
    
  • PARI
    forstep(k=1, 1e2, 2, print1(denominator(k/(2^k-1)), ", "));

A331895 Positive numbers k such that the binary and negabinary representations of k and the negabinary representation of -k are all palindromic.

Original entry on oeis.org

1, 5, 7, 17, 21, 31, 65, 85, 127, 257, 273, 325, 341, 455, 511, 1025, 1105, 1285, 1365, 1799, 2047, 4097, 4161, 4369, 4433, 5125, 5189, 5397, 5461, 7175, 7967, 8191, 16385, 16705, 17425, 17745, 20485, 20805, 21525, 21845, 28679, 29127, 31775, 32767, 65537, 65793
Offset: 1

Views

Author

Amiram Eldar, Jan 30 2020

Keywords

Comments

Numbers of the form 2^(2*m-1) - 1 (A083420) and 2^(2*m) + 1 (A052539) are terms.

Examples

			7 is a term since the binary representation of 7, 111, the negabinary representation of 7, 11011, and the negabinary representation of -7, 1001, are all palindromic.
		

Crossrefs

Intersection of A006995 and A331893.
Intersection of A331892 and A331894.

Programs

  • Mathematica
    binPalinQ[n_] := PalindromeQ @ IntegerDigits[n, 2]; negabin[n_] := negabin[n] = If[n==0, 0, negabin[Quotient[n-1, -2]]*10 + Mod[n, 2]]; nbPalinQ[n_] := And @@(PalindromeQ @ negabin[#] & /@ {n, -n}); Select[Range[2^16], binPalinQ[#] && nbPalinQ[#] &]

A368275 Fibonacci zig-zag function.

Original entry on oeis.org

1, 1, 2, 3, 6, 4, 10, 6, 11, 10, 15, 11, 17, 15, 18, 17, 22, 18, 26, 22, 27, 26, 29, 27, 33, 29, 34, 33, 36, 34, 40, 36, 41, 40, 45, 41, 49, 45, 50, 49, 54, 50, 56, 54, 57, 56, 61, 57, 63, 61, 64, 63, 68, 64, 70, 68, 71, 70, 75, 71, 77, 75, 78, 77, 82, 78, 86
Offset: 0

Views

Author

DarĂ­o Clavijo, Dec 19 2023

Keywords

Crossrefs

Programs

  • MATLAB
    function a = A368275( max_n )
         a = [1, 1, 2];
         for m = 4:max_n
             n = m-1;
             if mod(n,2) == 0
                a(m) = a(1 + (n/2)) + a(2 + (n/2)) + 1;
             else
                a(m) = a(1 + (n-1)/2) + a((n-1)/2) + 1;
             end
         end
    end % Thomas Scheuerle, Dec 19 2023
  • Mathematica
    a[0] = 1;a[1] = 1;a[2] = 2;a[n_Integer] := a[n] = Which[n == 0,1,n == 1,1,n == 2, 2,Mod[n, 2] == 1 && n >= 3, a[Quotient[(n-1),2]] + a[Quotient[(n-1),2]-1]+1,Mod[n,2] == 0 && n >= 4, a[Quotient[n,2]] + a[Quotient[n,2]+ 1]+1];result = Table[a[n],{n,0,66}] (* James C. McMahon, Dec 19 2023 *)
  • Python
    from functools import cache
    @cache
    def a(n):
      if n < 3: return [1,1,2][n]
      x, y = (n-1)>>1, n>>1
      if n & 1 == 1: return a(x) + a(x-1) + 1
      else: return a(y) + a(y+1) + 1
    print([a(n) for n in range(0,67)])
    

Formula

a(0)=1 and a(1)=1 and a(2)=2.
a(2*n+1) = a(n) + a(n-1) + 1, for n>=1.
a(2*n) = a(n) + a(n+1) + 1, for n>=2.
From Thomas Scheuerle, Dec 19 2023: (Start)
a(4^n+1) = (5*4^n - 8)/4, for n > 1.
a(2*4^n-1) = (5*4^n - 8)/2, for n > 0. (End)

A232710 Binary numbers (written in decimal) such that the sum of digits mod 2 equals the product of digits mod 2.

Original entry on oeis.org

0, 1, 5, 6, 7, 9, 10, 12, 17, 18, 20, 23, 24, 27, 29, 30, 31, 33, 34, 36, 39, 40, 43, 45, 46, 48, 51, 53, 54, 57, 58, 60, 65, 66, 68, 71, 72, 75, 77, 78, 80, 83, 85, 86, 89, 90, 92, 95, 96, 99, 101, 102, 105, 106, 108, 111, 113, 114, 116, 119, 120, 123, 125
Offset: 0

Views

Author

Jon Perry, Nov 28 2013

Keywords

Examples

			23 is in the sequence because 23 in binary is 10111. The sum of digits is 4 == 0 mod 2 and the products of digits is 0 == 0 mod 2.
		

Programs

  • JavaScript
    for (i=0;i<1000;i++) {
    s=i.toString(2).split("");
    sl=s.length;
    c=0;d=1;
    for (j=0;j
    				
  • PARI
    is(n)=b=binary(n);sum(i=1,#b,b[i])%2==prod(i=1,#b,b[i])%2 \\ Ralf Stephan, Nov 30 2013

Formula

A083420 UNION (A001969 \ {3}). - Ralf Stephan, Nov 30 2013

A233868 Numbers that are not the sum of two evil numbers.

Original entry on oeis.org

1, 2, 4, 7, 31, 127, 511, 2047, 8191, 32767, 131071, 524287, 2097151, 8388607, 33554431, 134217727, 536870911, 2147483647, 8589934591, 34359738367, 137438953471, 549755813887, 2199023255551, 8796093022207, 35184372088831
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Dec 17 2013

Keywords

Comments

2, 4 together with A083420. - R. J. Mathar, Dec 22 2013.
Also, numbers that are not the sum of two distinct odious numbers. - David Radcliffe, Jul 21 2016

Crossrefs

Cf. A000069, A000668, A001969, A083420, A175611 (primes that are not the sum of two positive evil numbers).

Formula

From Chai Wah Wu, Aug 02 2020: (Start)
a(n) = 5*a(n-1) - 4*a(n-2) for n > 5.
G.f.: x*(12*x^4 - 5*x^3 - 2*x^2 - 3*x + 1)/((x - 1)*(4*x - 1)). (End)

Extensions

Terms corrected by R. J. Mathar, Dec 22 2013

A303611 a(n) = (-1 - (-2)^(n-2)) mod 2^n.

Original entry on oeis.org

2, 1, 11, 7, 47, 31, 191, 127, 767, 511, 3071, 2047, 12287, 8191, 49151, 32767, 196607, 131071, 786431, 524287, 3145727, 2097151, 12582911, 8388607, 50331647, 33554431, 201326591, 134217727, 805306367, 536870911, 3221225471, 2147483647, 12884901887, 8589934591
Offset: 2

Views

Author

Vincenzo Librandi, May 07 2018

Keywords

Comments

A198693 and A083420 interleaved. From 11 onwards, apparently A283651 and A290195 contain the same terms. - Bruno Berselli, May 07 2018

Crossrefs

All terms belong to A052955 and A180516.

Programs

  • Magma
    [IsOdd(n) select 2^(n-2)-1 else 3*2^(n-2)-1: n in [2..40]];
    
  • Magma
    I:=[2,1,11]; [n le 3 select I[n] else Self(n-1)+4*Self(n-2)-4*Self(n-3): n in [1..35]];
    
  • Mathematica
    Table[If[OddQ[n], 2^(n - 2) - 1, 3 2^(n - 2) - 1], {n, 2, 80}]
    LinearRecurrence[{1, 4, -4}, {2, 1, 11}, 30]
  • PARI
    a(n) = if (n%2, 2^(n-2) - 1, 3*2^(n-2) - 1); \\ Michel Marcus, May 30 2018

Formula

a(n) = 2^(n-2) - 1 for odd n, otherwise a(n) = 3*2^(n-2) - 1, with n>1.
From Bruno Berselli, May 07 2018: (Start)
O.g.f.: x^2*(2 - x + 2*x^2)/((1 - x)*(1 - 2*x)*(1 + 2*x)).
E.g.f.: (1 + 2*x - 4*exp(x) + exp(-2*x) + 2*exp(2*x))/4.
a(n) = a(n-1) + 4*a(n-2) - 4*a(n-3).
a(n) = (2 + (-1)^n)*2^(n-2) - 1. (End)

A308267 Numbers k such that k divides A048678(k).

Original entry on oeis.org

1, 2, 4, 7, 8, 14, 16, 28, 31, 32, 56, 62, 64, 83, 112, 124, 127, 128, 166, 224, 248, 254, 256, 332, 397, 448, 496, 508, 511, 512, 664, 794, 891, 896, 992, 1016, 1022, 1024, 1163, 1328, 1588, 1782, 1792, 1984, 2032, 2044, 2047, 2048, 2326, 2656, 3176, 3441, 3564, 3584, 3968
Offset: 1

Views

Author

Dan Dart, May 17 2019

Keywords

Comments

Apparently includes all powers of 2.
All numbers 2^(2k+1)-1 are in this sequence, and if n is in this sequence then so is 2n. - Charlie Neder, May 17 2019

Examples

			The first few terms of A048678 are 1,2,5,4,9,10,21,8. 2 is a multiple of 2, 5 isn't a multiple of 3, 4 is a multiple of 4, 9 isn't a multiple of 5, 10 isn't a multiple of 6, 21 is a multiple of 7, etc.
		

Crossrefs

Cf. A048678, A083420 (subsequence).

Programs

  • Haskell
    bintodec :: [Integer] -> Integerbintodec = sum . zipWith (*) (iterate (*2) 1) . reverse
    decomp :: (Integer, [Integer]) -> (Integer, [Integer])decomp (x, ys) = if even x then (x `div` 2, 0:ys) else (x - 1, 1:ys)
    zeck :: Integer -> Integerzeck n = bintodec (1 : snd (last . takeWhile (\(x, _) -> x > 0) $ iterate decomp (n, [])))
    output :: [Integer]output = filter (\x -> 0 == zeck x `mod` x) [1..100]
    main :: IO ()main = print output
  • Mathematica
    Select[Range[4000], Divisible[FromDigits[Flatten[IntegerDigits[#, 2] /. {1 -> {0, 1}}], 2], #] &] (* Amiram Eldar, Jul 08 2019 after Robert G. Wilson v at A048678 *)

A316742 Stepping through the Mersenne sequence (A000225) one step back, two steps forward.

Original entry on oeis.org

1, 0, 3, 1, 7, 3, 15, 7, 31, 15, 63, 31, 127, 63, 255, 127, 511, 255, 1023, 511, 2047, 1023, 4095, 2047, 8191, 4095, 16383, 8191, 32767, 16383, 65535, 32767, 131071, 65535, 262143, 131071, 524287, 262143, 1048575, 524287, 2097151, 1048575, 4194303, 2097151, 8388607, 4194303
Offset: 0

Views

Author

Jim Singh, Jul 12 2018

Keywords

Examples

			Let 1. The first four terms are 1, (1-1)/2 = 0, 2*1+1 = 3, 1.
Let 4*1+3 = 7. The next four terms are 7, (7-1)/2 = 3, 2*7+1 = 15, 7.
Let 4*7+3 = 31. The next four terms are 31, (31-1)/2 = 15, 2*31+1 = 63, 31; etc.
		

Crossrefs

Programs

  • GAP
    a:=[1,0,3];; for n in [4..45] do a[n]:=a[n-1]+2*a[n-2]-2*a[n-3]; od; a; # Muniru A Asiru, Jul 14 2018
  • Maple
    seq(coeff(series((1-x+x^2)/((1-x)*(1-2*x^2)), x,n+1),x,n),n=0..45); # Muniru A Asiru, Jul 14 2018
  • Mathematica
    CoefficientList[Series[(1 - x + x^2)/((1 - x) (1 - 2 x^2)), {x, 0, 42}], x] (* Michael De Vlieger, Jul 13 2018 *)
    LinearRecurrence[{1, 2, -2}, {1, 0, 3}, 46] (* Robert G. Wilson v, Jul 21 2018 *)

Formula

a(n) = a(n-1) + 2*a(n-2) - 2*a(n-3) for n>2, a(0)=1, a(1)=0, a(2)=3.
From Bruno Berselli, Jul 12 2018: (Start)
G.f.: (1 - x + x^2)/((1 - x)*(1 - 2*x^2)).
a(n) = 2*a(n-2) + 1 for n>1, a(0)=1, a(1)=0.
a(n) = (1 + (-1)^n)*(2^(n/2) - 2^((n-3)/2)) + 2^((n-1)/2) - 1.
Therefore: a(4*k) = 2*4^k - 1, a(4*k+1) = 4^k - 1, a(4*k+2) = 4^(k+1) - 1, a(4*k+3) = 2*4^k - 1. (End)
Previous Showing 51-58 of 58 results.