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 31-40 of 853 results. Next

A309577 Table read by rows: T(n, k) is n with the first k bits removed from its binary expansion and then converted back to decimal, for 0 <= k <= A070939(n).

Original entry on oeis.org

1, 0, 2, 0, 0, 3, 1, 0, 4, 0, 0, 0, 5, 1, 1, 0, 6, 2, 0, 0, 7, 3, 1, 0, 8, 0, 0, 0, 0, 9, 1, 1, 1, 0, 10, 2, 2, 0, 0, 11, 3, 3, 1, 0, 12, 4, 0, 0, 0, 13, 5, 1, 1, 0, 14, 6, 2, 0, 0, 15, 7, 3, 1, 0, 16, 0, 0, 0, 0, 0, 17, 1, 1, 1, 1, 0, 18, 2, 2, 2, 0, 0, 19
Offset: 1

Views

Author

Peter Kagey, Aug 08 2019

Keywords

Examples

			For n = 26 and k = 2, T(26, 2) = 2 because 26 = 11010_2, and removing the first two bits leaves 010_2 = 2.
Table begins:
  n\k| 0 1 2 3 4
  ---+-----------
   1 | 1 0
   2 | 2 0 0
   3 | 3 1 0
   4 | 4 0 0 0
   5 | 5 1 1 0
   6 | 6 2 0 0
   7 | 7 3 1 0
   8 | 8 0 0 0 0
   9 | 9 1 1 1 0
		

Crossrefs

Programs

  • Mathematica
    T[n_, k_] := BitAnd[n, 2^k-1]; Table[T[n, k], {n, 1, 20}, {k, BitLength[n], 0, -1}] // Flatten (* Amiram Eldar, Aug 09 2019 *)
  • Ruby
    def t(n,k); n & (1 << n.bit_length - k) - 1 end

Formula

T(n,0) = n and T(n, A070939(n)) = 0.

A317441 a(n) = number of k with 1 <= k <= n-1 such that a(k) and a(n-k) have the same binary length (A070939).

Original entry on oeis.org

0, 1, 2, 1, 2, 3, 0, 5, 4, 1, 6, 3, 0, 5, 4, 1, 10, 5, 2, 7, 0, 7, 10, 5, 6, 7, 2, 5, 8, 5, 8, 7, 10, 9, 6, 7, 8, 7, 10, 11, 6, 7, 8, 11, 6, 17, 8, 9, 8, 19, 8, 13, 10, 15, 6, 19, 10, 9, 6, 19, 8, 13, 14, 13, 10, 17, 14, 15, 10, 19, 14, 9, 16, 15, 10, 11, 20
Offset: 1

Views

Author

Rémy Sigrist, Jul 28 2018

Keywords

Comments

See A317420 for similar sequences.

Examples

			For n = 4:
- A070939(a(1)) = 1 <> 2 = A070939(a(3)),
- A070939(a(2)) = 1 =  1 = A070939(a(2)),
- A070939(a(3)) = 2 <> 1 = A070939(a(1)),
- hence a(4) = 1.
		

Crossrefs

Programs

  • PARI
    l = vector(77); for (n=1, #l, l[n] = #binary(max(1, v=sum(k=1, n-1, l[k]==l[n-k]))); print1 (v ", "))

A320674 Positive integers m with binary expansion (b_1, ..., b_k) (where k = A070939(m)) such that b_i = [m == 0 (mod prime(i))] for i = 1..k (where prime(i) denotes the i-th prime number and [] is an Iverson bracket).

Original entry on oeis.org

2, 4, 6, 8, 10, 12, 16, 20, 24, 32, 40, 48, 64, 80, 96, 128, 160, 192, 256, 320, 384, 512, 640, 768, 1024, 1280, 1536, 2048, 2560, 3072, 4096, 5120, 6144, 8192, 10240, 12288, 16384, 20480, 24576, 32768, 40960, 49152, 65536, 81920, 98304, 131072, 163840, 196608
Offset: 1

Views

Author

Rémy Sigrist, Oct 19 2018

Keywords

Comments

In other words, the 1's in the binary representation of a term of this sequence encode the first prime divisors of this term.
All terms are even.
All even terms in A029747 belong to this sequence.
The term a(71) = 33554434 is the first one that does not belong to A029747.
See A320673 for similar sequences.

Examples

			The initial terms, alongside their binary representation and the prime divisors encoded therein, are:
  n   a(n)      bin(a(n))                   First prime divisors
  --  --------  --------------------------  --------------------
   1         2  10                          2
   2         4  100                         2
   3         6  110                         2, 3
   4         8  1000                        2
   5        10  1010                        2, 5
   6        12  1100                        2, 3
   7        16  10000                       2
   8        20  10100                       2, 5
   9        24  11000                       2, 3
  ...
  71  33554434  10000000000000000000000010  2, 97
  ...
33554434 is in the sequence because its binary expansion 10000000000000000000000010 of length 26 has a 1 in the 1st place and in the 25th place from the left and 0 elsewhere. As it is divisible by the 1st and 25th prime and by no other prime with index <= 26, 33554434 in the sequence. - _David A. Corneth_, Oct 20 2018
		

Crossrefs

Programs

  • Mathematica
    selQ[n_] := With[{bb = IntegerDigits[n, 2]}, (Prime /@ Flatten[Position[bb, 1]]) == FactorInteger[n][[All, 1]]];
    Select[Range[2, 200000], selQ] (* Jean-François Alcover, Nov 01 2018 *)
  • PARI
    is(n) = my (b=binary(n)); b==vector(#b, k, n%prime(k)==0)

A338433 Values of n for which A070939(n^3) differs from A004221(n).

Original entry on oeis.org

1, 20, 40, 80, 101, 126, 127, 159, 160, 161, 200, 201, 202, 203, 252, 253, 254, 255, 317, 318, 319, 320, 321, 322, 399, 400, 401, 402, 403, 404, 405, 406, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645
Offset: 1

Views

Author

Jeremy Gardiner, Oct 27 2020

Keywords

Comments

Sequence gives the values of n for which the length of the binary representation of n^3 differs from ceiling(10*log_10(n)) rounded up.
The largest number not in the sequence is 158489319246111348520210137339 = floor(10^29.2). - Robert Israel, Oct 27 2020

Crossrefs

Programs

  • Maple
    filter:= n -> evalb(ilog2(n^3)+1 <> ceil(10*log[10](n))):
    select(filter, [$1..1000]); # Robert Israel, Oct 27 2020
  • Mathematica
    Select[Range[1000], IntegerLength[#^3, 2] != Ceiling[10*Log10[#]] &] (* Amiram Eldar, Oct 27 2020 *)

A344851 a(n) = (n^2) mod (2^A070939(n)).

Original entry on oeis.org

0, 1, 0, 1, 0, 1, 4, 1, 0, 1, 4, 9, 0, 9, 4, 1, 0, 1, 4, 9, 16, 25, 4, 17, 0, 17, 4, 25, 16, 9, 4, 1, 0, 1, 4, 9, 16, 25, 36, 49, 0, 17, 36, 57, 16, 41, 4, 33, 0, 33, 4, 41, 16, 57, 36, 17, 0, 49, 36, 25, 16, 9, 4, 1, 0, 1, 4, 9, 16, 25, 36, 49, 64, 81, 100
Offset: 0

Views

Author

Rémy Sigrist, May 30 2021

Keywords

Comments

Informally, if n has w binary digits, a(n) is obtained by keeping the w final binary digits of n^2.
For n > 0, a(n) is the final digit of n^2 in base A062383(n).
This sequence has interesting graphical features (see illustration in Links section).

Examples

			For n = 42:
- A070939(42) = 6,
- a(42) = (42^2) mod (2^6) = 1764 mod 64 = 36.
		

Crossrefs

Cf. A000290, A048152, A062383, A070939, A086341, A116882, A316347 (decimal analog).

Programs

  • Mathematica
    {0}~Join~Table[Mod[n^2,2^(1+Floor@Log2@n)],{n,100}] (* Giorgos Kalogeropoulos, Jun 02 2021 *)
  • PARI
    a(n) = (n^2) % 2^#binary(n)
    
  • Python
    def a(n): return (n**2) % (2**n.bit_length())
    print([a(n) for n in range(75)]) # Michael S. Branicky, May 30 2021

Formula

a(n) = 0 iff n = 0 or n > 1 and n belongs to A116882.
a(n) = 1 iff n belongs to A086341.
a(2^k + m) = a(2^(k+1)-m) for any k > 0 and m = 0..2^k.

A352961 a(0) = 0, a(1) = 1, and for any n > 1, a(n) = a(n-2^e) + a(n-2^(e+1)) with e as large as possible (e = A070939(n) - 2).

Original entry on oeis.org

0, 1, 1, 2, 1, 3, 2, 5, 1, 4, 3, 7, 2, 7, 5, 12, 1, 5, 4, 9, 3, 10, 7, 17, 2, 9, 7, 16, 5, 17, 12, 29, 1, 6, 5, 11, 4, 13, 9, 22, 3, 13, 10, 23, 7, 24, 17, 41, 2, 11, 9, 20, 7, 23, 16, 39, 5, 22, 17, 39, 12, 41, 29, 70, 1, 7, 6, 13, 5, 16, 11, 27, 4, 17, 13
Offset: 0

Views

Author

Rémy Sigrist, Apr 11 2022

Keywords

Comments

This sequence is a variant of the Fibonacci sequence (A000045) with variable steps.

Examples

			a(0) = 0 by definition.
a(1) = 1 by definition.
a(2) = a(2-2^0) + a(2-2^1) = a(1) + a(0) = 1 + 0 = 1.
a(3) = a(3-2^0) + a(3-2^1) = a(2) + a(1) = 1 + 1 = 2.
a(4) = a(4-2^1) + a(4-2^2) = a(2) + a(0) = 1 + 0 = 1.
a(5) = a(5-2^1) + a(5-2^2) = a(3) + a(1) = 2 + 1 = 3.
a(6) = a(6-2^1) + a(6-2^2) = a(4) + a(2) = 1 + 1 = 2.
a(7) = a(7-2^1) + a(7-2^2) = a(5) + a(3) = 3 + 2 = 5.
a(8) = a(8-2^2) + a(8-2^3) = a(4) + a(0) = 1 + 0 = 1.
		

Crossrefs

See A352964 for a similar sequence.

Programs

  • PARI
    { for (n=1, #a=vector(75), print1 (a[n]=if (n==1, 0, n==2, 1, e=#binary(n-1)-2; a[n-2^e]+a[n-2^(e+1)]),", ")) }

Formula

a(2*n) = a(n).

A359450 a(1) = 1, a(2) = 2; thereafter a(n) = n * a(A070939(n)).

Original entry on oeis.org

1, 2, 6, 24, 30, 36, 42, 192, 216, 240, 264, 288, 312, 336, 360, 480, 510, 540, 570, 600, 630, 660, 690, 720, 750, 780, 810, 840, 870, 900, 930, 1152, 1188, 1224, 1260, 1296, 1332, 1368, 1404, 1440, 1476, 1512, 1548, 1584, 1620, 1656, 1692, 1728, 1764, 1800, 1836
Offset: 1

Views

Author

Amiram Eldar, Jan 02 2023

Keywords

Comments

Problem A6 of the 63rd Putnam Competition (2002) asked to prove that when this sequence is generalized to base-b digits, the sum of reciprocals converges only for b = 2.
Problem 2 in Appendix D of Bornemann et al. (2004) asked to calculate the sum of the reciprocals of this sequence.

References

  • Daniel D. Bonar and Michael J. Khoury, Jr., Real infinite Series, The Mathematical Association of America, 2006, pp. 159, 190-191.
  • Hongwei Chen, Classical Analysis: An Approach through Problems, CRC Press, 2022, p. 118, exercise 34.
  • Kiran S. Kedlaya, Daniel M. Kane, Jonathan M. Kane, and Evan M. O'Dorney, The William Lowell Putnam Mathematical Competition 2001-2016: Problems, Solutions, and Commentary, American Mathematical Society, 2020, pp. 86-87.

Crossrefs

Programs

  • Mathematica
    a[1] = 1; a[2] = 2; a[n_] := a[n] = n * a[BitLength[n]]; Array[a, 100]
  • PARI
    a(n) = if(n < 3, n, n * a(#binary(n)));

Formula

Sum_{n>=1} 1/a(n) = A359451.

A368877 a(n) = f^k(n) where f(n) = A014682(n), the Collatz map, and k = A070939(n), the length of n in base 2.

Original entry on oeis.org

2, 2, 8, 2, 2, 8, 26, 2, 17, 2, 20, 8, 8, 26, 80, 2, 5, 17, 17, 2, 2, 20, 20, 8, 22, 8, 71, 26, 26, 80, 242, 2, 44, 5, 5, 17, 17, 17, 152, 2, 161, 2, 56, 20, 20, 20, 182, 8, 7, 22, 22, 8, 8, 71, 71, 26, 74, 26, 76, 80, 80, 242, 728, 2, 14, 44, 44, 5, 5, 5, 137, 17, 47, 17, 16
Offset: 1

Views

Author

Michel Marcus, Jan 08 2024

Keywords

Comments

This is the jump function jp in the paper of Eliahou et al.

Crossrefs

Programs

  • Mathematica
    A368877[n_] := Nest[If[OddQ[#], (3*#+1)/2, #/2]&, n, BitLength[n]];
    Array[A368877, 100] (* Paolo Xausa, Jan 08 2024 *)
  • PARI
    T(n) = if (n%2, (3*n+1)/2, n/2); \\ A014682
    a(n) = my(N=1+logint(n, 2)); for (i=1, N, n = T(n)); n;

A380230 a(n) = n*A070939(n).

Original entry on oeis.org

0, 1, 4, 6, 12, 15, 18, 21, 32, 36, 40, 44, 48, 52, 56, 60, 80, 85, 90, 95, 100, 105, 110, 115, 120, 125, 130, 135, 140, 145, 150, 155, 192, 198, 204, 210, 216, 222, 228, 234, 240, 246, 252, 258, 264, 270, 276, 282, 288, 294, 300, 306, 312, 318, 324, 330, 336, 342
Offset: 0

Views

Author

Paolo Xausa, Jan 17 2025

Keywords

Crossrefs

Programs

  • Mathematica
    Table[n*BitLength[n], {n, 0, 100}]

A226836 Squares s such that first m and last m digits of the binary representation are perfect positive squares written in binary, and m = floor(binaryLength(s)/2), where binaryLength(s) = A070939(s) is the binary length of s.

Original entry on oeis.org

36, 289, 4624, 10404, 115600, 248004, 1083681, 1281424, 2232036, 2509056, 21307456, 23892544, 31494544, 40144896, 66357316, 271359729, 340919296, 479785216, 512026384, 597215844, 767068416, 4831918144, 5454708736, 8126661904, 8522982400, 12273094656, 16705045504
Offset: 1

Views

Author

Alex Ratushnyak, Jun 19 2013

Keywords

Comments

The sequence of roots of a(n) begins: 6, 17, 68, 102, 340, 498, 1041, 1132, 1494, 1584, 4616, 4888, 5612, 6336, 8146, 16473, 18464, 21904, 22628, 24438, 27696, 69512, 73856, 90148, 92320, ...

Crossrefs

Programs

  • C
    #include 
    #include 
    typedef unsigned long long U64;
    U64 isSquare(U64 a) {
        U64 s = sqrt(a);
        return (s*s==a);
    }
    int main() {
      U64 i, j, n, sq, s, S;
      for (n = 1; n < (1ULL<<20); ++n) {
        for (i = 64, j = sq = n*n; j < (1ULL<<63); j += j)
          --i;  // binary length of sq
        j = i >> 1;  //  Sbs or Ss, binary length of s is j
        s = sq & ((1ULL<> (j+(i&1));
        if (isSquare(S) && s && isSquare(s)) printf("%llu, ", sq);
      }
      return 0;
    }
Previous Showing 31-40 of 853 results. Next