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-10 of 10 results.

A004760 List of numbers whose binary expansion does not begin 10.

Original entry on oeis.org

0, 1, 3, 6, 7, 12, 13, 14, 15, 24, 25, 26, 27, 28, 29, 30, 31, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122
Offset: 1

Views

Author

Keywords

Comments

For n >= 2 sequence {a(n+2)} is the minimal recursive such that A007814(a(n+2))=A007814(n). - Vladimir Shevelev, Apr 27 2009
A053645(a(n)) = n-1 for n > 0. - Reinhard Zumkeller, May 20 2009
a(n+1) is also the number of nodes in a complete binary tree with n nodes in the bottommost level. - Jacob Jona Fahlenkamp, Feb 01 2023

Crossrefs

Programs

  • Maple
    0,1,seq(seq(3*2^d+x,x=0..2^d-1),d=0..6); # Robert Israel, Aug 03 2016
  • Mathematica
    Select[Range@ 125, If[Length@ # < 2, #, Take[#, 2]] &@ IntegerDigits[#, 2] != {1, 0} &] (* Michael De Vlieger, Aug 02 2016 *)
  • PARI
    is(n)=n<2 || binary(n)[2] \\ Charles R Greathouse IV, Sep 23 2012
    
  • PARI
    print1("0, 1");for(i=0,5,for(n=3<Charles R Greathouse IV, Sep 23 2012
    
  • PARI
    a(n) = if(n<=2,n-1, (n-=2) + 2<Kevin Ryde, Jul 22 2022
    
  • Python
    def A004760(n): return m+(1<0 else n-1 # Chai Wah Wu, Jul 26 2023
  • R
    maxrow <- 8 # by choice
    b01 <- 1
    for(m in 0:maxrow){
      b01 <- c(b01,rep(1,2^(m+1))); b01[2^(m+1):(2^(m+1)+2^m-1)] <- 0
    }
    a <- which(b01 == 1)
    # Yosu Yurramendi, Mar 30 2017
    

Formula

For n > 0, a(n) = 3n - 2 - A006257(n-1). - Ralf Stephan, Sep 16 2003
a(0) = 0, a(1) = 1, for n > 0: a(2n) = 2*a(n) + 1, a(2n+1) = 2*a(n+1). - Philippe Deléham, Feb 29 2004
For n >= 3, A007814(a(n)) = A007814(n-2). - Vladimir Shevelev, Apr 15 2009
a(n+2) = min{m>a(n+1): A007814(m)=A007814(n)}; A010060(a(n+2)) = 1-A010060(n). - Vladimir Shevelev, Apr 27 2009
a(1)=0, a(2)=1, a(2^m+k+2) = 2^(m+1) + 2^m+k, m >= 0, 0 <= k < 2^m. - Yosu Yurramendi, Jul 30 2016
G.f.: x/(1-x)^2 + (x/(1-x))*Sum_{k>=0} 2^k*x^(2^k). - Robert Israel, Aug 03 2016
a(2^m+k) = A004761(2^m+k) + 2^m, m >= 0, 0 <= k < 2^m. - Yosu Yurramendi, Aug 08 2016
For n > 0, a(n+1) = n + 2^ceiling(log_2(n)) - 1. - Jacob Jona Fahlenkamp, Feb 01 2023

Extensions

Offset changed to 1, b-file corrected. - N. J. A. Sloane, Aug 07 2016

A159615 The slowest increasing sequence beginning with a(1)=2 such that a(n) and n are both odious or both not odious.

Original entry on oeis.org

2, 4, 5, 7, 9, 10, 11, 13, 15, 17, 19, 20, 21, 22, 23, 25, 27, 29, 31, 33, 35, 37, 39, 40, 41, 42, 43, 44, 45, 46, 47, 49, 51, 53, 55, 57, 59, 61, 63, 65, 67, 69, 71, 73, 75, 77, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 97, 99, 101, 103, 105, 107, 109, 111
Offset: 1

Views

Author

Vladimir Shevelev, Apr 17 2009

Keywords

Examples

			If n=3, then k=1, j=0, therefore a(6)=(10*3-4*0)/3=10.
		

Crossrefs

Programs

  • Maple
    read("transforms") ; isA000069 := proc(n) option remember ; RETURN( type(wt(n),'odd') ) ; end:
    A159615 := proc(n) option remember; if n = 1 then 2; else for a from procname(n-1)+1 do if isA000069(a) = isA000069(n) then RETURN(a) ; fi; od: fi; end:
    seq(A159615(n),n=1..120) ; # R. J. Mathar, Aug 17 2009
  • Mathematica
    odiousQ[n_] := OddQ[DigitCount[n, 2, 1]];
    a[1] = 2; a[n_] := a[n] = For[k = a[n-1]+1, True, k++, If[FreeQ[Array[a, n-1], k] && odiousQ[n] && odiousQ[k] || !odiousQ[n] && !odiousQ[k], Return[k] ] ];
    Array[a, 80] (* Jean-François Alcover, Dec 10 2017 *)

Formula

For n>=1, a(n)=min{m>a(n-1): A010060(m)=A010060(n)}.
a(2n+1)=2a(n)+1.
a(2n)=3n+1+j,if n=2^k+j; a(2n)=(10n-4j)/3,if n=2^k+2^(k-1)+j, where 0<=j<=2^(k-1)-1.

Extensions

Edited and extended by R. J. Mathar, Aug 17 2009

A159619 Slowest increasing sequence beginning with 4 such that n and a(n) are either both evil or both odious.

Original entry on oeis.org

4, 7, 9, 11, 12, 15, 16, 19, 20, 23, 25, 27, 28, 31, 33, 35, 36, 39, 41, 43, 44, 47, 48, 51, 52, 55, 57, 59, 60, 63, 64, 67, 68, 71, 73, 75, 76, 79, 80, 83, 84, 87, 89, 91, 92, 95, 97, 99, 100, 103, 105, 107, 108, 111, 112, 115, 116, 119, 121, 123, 124, 127, 129, 131, 132, 135, 137
Offset: 1

Views

Author

Vladimir Shevelev, Apr 17 2009, Apr 27 2009, May 04 2009

Keywords

Comments

(i) Theorem: For every initial value a(1) > 4, a minimum index n exists such that the a(n) obtained from that initial value coincides with this sequence here. Thus there exist essentially two slowest increasing sequences with this type of evil/odious congruence: A159615 and this one here.
(ii) In connection with this theorem, one can generalize to slowest increasing sequences a_m(n), a_m(1)=m, which let n and a(n) be at the same time in or not in some increasing sequence c(n). (This sequence here is c = A000069, m=4.)
We define a rank r of c as the minimum value a_r(1) such that for sufficiently large n (n depending on m) all sequences a_m(n), m>r, coincide with a_r(n).
In particular, c(n)=A004760(n+1) has rank r=2, and A000069 has rank r=3.
The problems are: 1) to find a sequence of rank r >= 4; 2) to find the rank of primes or to prove that it does not exist (in case of which it could be defined as infinity).
There is a conjecture arising in Sequence Machine that a(n) = A026491(2+n)-1. This appears to be true: Here we start from on odious or evil number and apply a minimum number of van-Eck-Transforms (of A171898) to reach a value larger than a(n-1). The Dekking formula in A026491 says that A026491 is essentially a partial sum of the backward van-Eck-Transforms, and in a (vague) manner this seems to match.
- R. J. Mathar, Jun 24 2021

Crossrefs

Programs

  • Maple
    read("transforms") ; isA000069 := proc(n) option remember ; RETURN( type(wt(n), 'odd') ) ; end:
    A159619 := proc(n) option remember; if n = 1 then 4; else for a from procname(n-1)+1 do if isA000069(a) = isA000069(n) then RETURN(a) ; fi; od: fi; end:
    seq(A159619(n), n=1..120) ; # R. J. Mathar, Mar 25 2010
  • Mathematica
    a[n_] := 2 * n + If[EvenQ[n] || EvenQ[IntegerExponent[n+1, 2]], 3, 2]; Array[a, 100] (* Amiram Eldar, Aug 30 2024 *)
  • PARI
    a(n) = 2 * n + if(!(n % 2) || !(valuation(n+1, 2) % 2), 3, 2); \\ Amiram Eldar, Aug 30 2024

Formula

a(n) = 2n+3 if n*A007814(n+1) is even, and a(n) = 2n+2 otherwise.

Extensions

Edited and extended by R. J. Mathar, Mar 25 2010

A004759 Binary expansion starts 111.

Original entry on oeis.org

7, 14, 15, 28, 29, 30, 31, 56, 57, 58, 59, 60, 61, 62, 63, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244
Offset: 1

Views

Author

Keywords

Comments

This is the minimal recursive sequence such that a(1)=7, A007814(a(n))= A007814(n) and A010060(a(n))=A010060(n). - Vladimir Shevelev, Apr 23 2009

Examples

			30 in binary is 11110, so 30 is in sequence.
		

Crossrefs

Programs

  • Haskell
    import Data.List (transpose)
    a004759 n = a004759_list !! (n-1)
    a004759_list = 7 : concat (transpose [zs, map (+ 1) zs])
                       where zs = map (* 2) a004759_list
    -- Reinhard Zumkeller, Dec 03 2015
    
  • Mathematica
    w = {1, 1, 1}; Select[Range[5, 244], If[# < 2^(Length@ w - 1), True, Take[IntegerDigits[#, 2], Length@ w] == w] &] (* Michael De Vlieger, Aug 10 2016 *)
    Sort[FromDigits[#,2]&/@(Flatten[Table[Join[{1,1,1},#]&/@Tuples[{1,0},n],{n,0,5}],1])] (* Harvey P. Dale, Sep 01 2016 *)
  • PARI
    a(n)=n+6*2^floor(log(n)/log(2))
    
  • Python
    def A004759(n): return n+(3<Chai Wah Wu, Jul 13 2022

Formula

a(2n) = 2a(n), a(2n+1) = 2a(n) + 1 + 6[n==0].
a(n) = n + 6 * 2^floor(log_2(n)) = A004758(n) + A053644(n).
a(n+1) = min{m > a(n): A007814(m) = A007814(n+1) and A010060(m) = A010060(n+1)}. a(2^k) - a(2^k-1) = A103204(k+2), k >= 1. - Vladimir Shevelev, Apr 23 2009
a(2^m+k) = 7*2^m + k, m >= 0, 0 <= k < 2^m. - Yosu Yurramendi, Aug 08 2016

Extensions

Edited by Ralf Stephan, Oct 12 2003

A159698 Minimal increasing sequence beginning with 4 such that n and a(n) are either both prime or both nonprime.

Original entry on oeis.org

4, 5, 7, 8, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 29, 30, 32, 33, 37, 38, 39, 40, 42, 44, 47, 48, 53, 54, 55, 56, 57, 58, 59, 60, 62, 63, 67, 68, 71, 72, 74, 75, 79, 80, 81, 82, 84, 85, 89, 90, 91, 92, 93, 94, 97, 98, 101, 102, 104, 105, 106, 108, 109, 110, 111, 112
Offset: 1

Views

Author

Vladimir Shevelev, Apr 20 2009, May 04 2009

Keywords

Comments

For n >= 11, a(n) = A159559(n), which means the two sequences merge.
We may define other sequences a(p-1,n), p prime, which start a(p-1,1)=p-1 and with the same property of n and a(p-1,n) being jointly prime or nonprime.
We find that for p=7, 11 and 13, the sequences a(6,n), a(10,n) and a(12,n) also merge with the current sequence for sufficiently large n. Does this also hold for primes >=17?
It was verified for primes p with 7<=p<=223 that this sequence a(4,n) and a(p-1,n) eventually merge. The corresponding values of n are 47, 683, 1117, 6257, 390703. - Alois P. Heinz, Mar 09 2011

Crossrefs

Programs

  • Maple
    a:= proc(n) option remember; local m;
          if n=1 then 4
        else for m from a(n-1)+1 while isprime(m) xor isprime(n)
             do od; m
          fi
        end:
    seq(a(n), n=1..80);  # Alois P. Heinz, Nov 21 2010
  • Mathematica
    a[n_] := a[n] = If[n==1, 4, For[m = a[n-1]+1, Xor[PrimeQ[m], PrimeQ[n]], m++]; m]; Table[a[n], {n, 1, 80}] (* Jean-François Alcover, Jan 31 2016, after Alois P. Heinz *)

Formula

a(1) = 4; for n>1, a(n) = min { m > a(n-1) : m is prime iff n is prime }.

Extensions

More terms from Alois P. Heinz, Nov 21 2010

A159629 Slowest increasing sequence beginning with a(1)=4 such that A002828(a(n)) = A002828(n).

Original entry on oeis.org

4, 5, 6, 9, 10, 11, 15, 17, 25, 26, 27, 30, 32, 33, 39, 49, 50, 52, 54, 58, 59, 62, 63, 66, 81, 82, 83, 87, 89, 91, 92, 97, 99, 101, 102, 121, 122, 123, 124, 125, 128, 129, 131, 132, 136, 138, 143, 147, 169, 170, 171, 173, 178, 179, 183, 184, 186, 193, 195, 199, 200, 201, 207
Offset: 1

Views

Author

Vladimir Shevelev, Apr 17 2009, May 04 2009

Keywords

Comments

Conjecture: For every m>2 there exists a minimum index N(m) such that the minimal increasing recursive sequence S_m(n) beginning with m^2 with the condition A002828(S_m(n)) = A002828(n) coincides with a(n) for all n>N.

Crossrefs

Programs

  • Mathematica
    a2828[n_] := Which[SquaresR[1, n]>0, 1, SquaresR[2, n]>0, 2, SquaresR[3, n] > 0, 3, True, 4];
    a[1] = 4; a[n_] := a[n] = For[k = a[n-1]+1, True, k++, If[a2828[k] == a2828[n], Return[k]]];
    Array[a, 63] (* Jean-François Alcover, Jul 28 2018 *)

Formula

a(n+1) = min { l > a(n) : A002828(l) = A002828(n+1) }.

Extensions

137 replaced by 136, extended by R. J. Mathar, Sep 17 2009

A172980 a(1)=1, a(2)=3; for n>=3, a(n) is the smallest number larger than a(n-1) such that, for every k

Original entry on oeis.org

1, 3, 4, 9, 11, 12, 13, 15, 16, 33, 37, 42, 43, 117, 154, 159, 163, 168, 173, 231, 338, 555, 557, 558, 649, 1161, 1168, 1209, 1213, 1254, 1259, 1263, 1406, 1467, 1573, 1578, 1579, 2595, 2752, 2805, 2813, 2964, 2969, 2997, 3014, 5013, 5021, 5022, 5057, 5115
Offset: 1

Views

Author

Vladimir Shevelev, Nov 21 2010

Keywords

Comments

Using the Chinese remainder theorem, it is easy to prove that the sequence is infinite.

Crossrefs

Programs

  • Maple
    a:= proc(n) option remember;
         local ok, m, k;
         if n<3 then 2*n-1
       else for m from a(n-1)+1 do
              ok:= true;
              for k from 1 to n-1 do
                if igcd(n, k)=1 xor igcd(m, a(k))=1
                   then ok:= false; break fi
              od;
              if ok then break fi
            od; m
         fi
        end:
    seq (a(n), n=1..50);  # Alois P. Heinz, Nov 21 2010
  • Mathematica
    a[1]=1; a[2]=3; a[n_] := a[n] = For[k = a[n-1]+1, True, k++, If[AllTrue[ Range[n-1], CoprimeQ[k, a[#]] == CoprimeQ[n, #]&], Return[k]]]; Table[ a[n], {n, 1, 100}] (* Jean-François Alcover, Jan 25 2017 *)

Extensions

More terms from Alois P. Heinz, Nov 21 2010

A172999 a(1)=1, a(2)=4; for n>=3, a(n) is the smallest number larger than a(n-1) such that, for every k

Original entry on oeis.org

1, 4, 5, 6, 7, 10, 11, 12, 25, 28, 29, 30, 31, 44, 175, 178, 179, 180, 181, 182, 275, 348, 349, 360, 371, 372, 395, 396, 397, 420, 421, 422, 725, 1074, 1309, 1310, 1319, 1448, 2945, 2954, 2957, 2970, 2971, 3016, 3325, 4188, 4189, 4190, 4213, 4214, 4475, 4526
Offset: 1

Views

Author

Vladimir Shevelev, Nov 21 2010

Keywords

Crossrefs

Programs

  • Maple
    a:= proc(n) option remember;
         local ok, m, k;
         if n<3 then 3*n-2
       else for m from a(n-1)+1 do
              ok:= true;
              for k from 1 to n-1 do
                if igcd(n, k)=1 xor igcd(m, a(k))=1
                   then ok:= false; break fi
              od;
              if ok then break fi
            od; m
         fi
        end:
    seq (a(n), n=1..50);  # Alois P. Heinz, Nov 21 2010
  • Mathematica
    t={1,4}; Do[nxt=t[[-1]]+1; While[CoprimeQ[n,Range[n-1]] != CoprimeQ[nxt,t], nxt++]; AppendTo[t,nxt], {n,3,50}]; t

Extensions

More terms from Alois P. Heinz, Nov 21 2010

A151976 Minimal recursive sequence beginning with 5 similar to N with respect to property of integer to be or not to be in A079523.

Original entry on oeis.org

5, 6, 8, 10, 13, 14, 17, 18, 21, 22, 24, 26, 29, 30, 32, 34, 37, 38, 40, 42, 45, 46, 49, 50, 53, 54, 56, 58, 61
Offset: 1

Views

Author

Vladimir Shevelev, Jul 12 2009

Keywords

Examples

			a(2)=6 since 6>5 is the minimal integer such that 2 and 6 simultaneously are not in A079523.
		

Crossrefs

Formula

For n>=1, a(n+1)=min{m>a(n): A035263(m)=A035263(n+1)}

A151994 For k=A079523(n),n>=2, let {S_k} be the minimal recursive sequence beginning with k similar to N with respect to property of integer to be or not to be in A079523. Then a(n) is the point of confluence of {S_k} with {S_5}.

Original entry on oeis.org

5, 13, 13, 29, 29, 61, 61, 61, 61
Offset: 2

Views

Author

Vladimir Shevelev, Jul 12 2009

Keywords

Examples

			Note that, {S_5} is {5,6,8,10,13,...}(see A162736) and {S_7} is {7,8,10,11,13,...}, then a(3)=13.
		

Crossrefs

Showing 1-10 of 10 results.