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

A213891 Fixed points of the sequence A262212 defined by the minimum number of 2's in the relation n*[n,2,2,...,2,n] = [x,...,x] between simple continued fractions.

Original entry on oeis.org

3, 11, 19, 43, 67, 83, 107, 131, 139, 163, 211, 283, 307, 331, 347, 467, 491, 499, 523, 547, 563, 571, 587, 619, 659, 691, 739, 787, 811, 859, 883, 907, 947, 971, 1019, 1051, 1123, 1163, 1171, 1283, 1291, 1307
Offset: 1

Views

Author

Art DuPre, Jun 23 2012

Keywords

Comments

It has long been a problem to find "natural" functions which will produce only primes. The sequence here apparently does just that, and it may well be the most natural function yet doing just that. There is apparently no reason why these sequences should produce only primes.
Let [a,b,...,c] = a+1/(b+(1/...+1/c)) represent a simple continued fraction.
Consider for n=2 the continued fraction [2,1,2] = 8/3. If we multiply 8/3 by 2, we get 16/3. If we write 16/3 as a continued fraction, we get [5,3]. Since the first entry 5 of this sequence is not equal to the last, 3, we insert another 1 in [2,1,2] between n and n to get [n,1,1,n] = 13/5. If we multiply 13/5 by 2, we get 26/5. If we write 26/5 as a continued fraction, we get [5,5] and now the first entry 5, of [5,5] is the same as the last entry 5 of [5,5]. Therefore 2 is the first number of 1s that we had to insert between the 1s in order for twice the resulting continued fraction to have equal first and last entries. Therefore, we define g(2)=2.
If we do the same for n=3, [3,1,3], we see that 3 is the minimum number of 1s that we have to insert between the 3s in order that when we multiply the continued fraction [3,1,1,1,3] by 3, we get [10,1,10], so the first and last entries are the same, namely 10. Therefore we define g(3)=3.
If we do this for n=4, [4,1,4] we see that 5 is the minimum number of 1s we have to insert before the first and last entries of 4*[4,1,1,1,1,1,4] are the same, namely, we get [18,2,18]. If we had multiplied [4,1,4], [4,1,1,4], [4,1,1,1,4],[4,1,1,1,1,4] by 4 we get, respectively [19,5],[18,4,2],[18,1,1,3],[18,2,2,3], none of which has its first and last entries equal. Therefore we define g(4)=5.
It turns out, proceeding as we just have, we get g(5)=4, g(6)=11, g(7)=7, which is A213648. If we define a sequence b(n) to contain the fixed points for which g(n)=n, considering that the sequence A213648 starts with 2 as its second term, then we get A000057 connected with the prime divisors of all the Fibonacci sequences.
If we do the same for inserting 2s as we just described for 1s, we get this sequence here.
These primes arise by first looking at the sequence h(n), whose n-th term is the minimum number of twos in [n,2,2,....,2,n], so that the continued fraction of n times the fraction corresponding to the above quotients has its first and last term equal. Next we construct the sequence of fixed points where h(n)=n. This sequence consists of prime numbers (conjecture). We conjecture that this sequence of prime numbers is analogous to A000057, in the sense that, instead of referring to the Fibonacci sequences it refers to the generalized Fibonacci sequences satisfying f(n)=2*f(n-1)+f(n-2). This would mean that a prime is in this sequence here if and only if it divides some term in each of the sequences satisfying f(n)=2*f(n-1)+f(n-2).

Examples

			The basic sequence h(n) (= A262212) is for n = 3,4,5,..:
3*[3, 2, 2, 2, 3] = [10,4,10], h(3) = 3: the first fixed point a(1) = 3.
4*[4, 2, 2, 2, 4] = [17, 1, 1, 1, 17], h(4) = 3;
5*[5, 2, 2, 5] = [27, 27], h(5) = 2;
6*[6, 2, 2, 2, 6] = [38, 2, 38], h(6) = 3;
(...)
11*[11, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 11] = [125, 1, 1, 3, 1, 14, 1, 3, 1, 1, 125] , h(11) = 11: this is the next fixed point after 3, so a(2)=11.
		

Crossrefs

Programs

  • Maple
    simpcf := proc(L)
            if nops(L) = 1 then
                    op(1,L) ;
            else
                    op(1,L)+1/procname([op(2..nops(L),L)]) ;
            end if;
    end proc:
    A213891aux := proc(n)
            local h,ins,c ;
            for ins from 1 do
                    c := [n,seq(2,i=1..ins),n] ;
                    h := numtheory[cfrac](n*simpcf(c),quotients) ;
                    if op(1,h) = op(-1,h) then
                            return ins;
                    end if;
            end do:
    end proc:
    A213891 := proc(n)
            if n = 1 then
                    3;
            else
                    for a from procname(n-1)+1 do
                            if A213891aux(a) = a then
                                    return a;
                            end if;
                    end do:
            end if;
    end proc: # R. J. Mathar, Jul 06 2012
  • Mathematica
    f[m_, n_] := Block[{c, k = 1}, c[x_, y_] := ContinuedFraction[x FromContinuedFraction[Join[{x}, Table[m, {y}], {x}]]]; While[First@ c[n, k] != Last@ c[n, k], k++]; k]; Select[Range[2, 1000], f[2, #] == # &] (* Michael De Vlieger, Sep 16 2015 *)
  • PARI
    {a(n) = local(t, m=1); if( n<2, 0, while( 1,
       t = contfracpnqn( concat([n, vector(m,i,2), n]));
       t = contfrac(n*t[1,1]/t[2,1]);
       if(t[1]
    				
  • PARI
    forprime(p=2,999, A262212(p)==p&&print1(p",")) \\ M. F. Hasler, Sep 30 2015

Extensions

Edited by R. J. Mathar and T. D. Noe, Jul 06 2012
Edited by M. F. Hasler, Sep 30 2015

A214030 The multiplication continued fraction sequence for 2,3,2,3...

Original entry on oeis.org

0, 1, 5, 3, 4, 5, 2, 3, 5, 9, 4, 11, 13, 5, 29, 3, 15, 5, 19, 19, 5, 9, 23, 11, 13, 17, 11, 14, 29, 7, 7, 29, 15, 14, 11, 37, 19, 41, 19, 41, 5, 13, 19, 29, 23, 47, 11, 20, 49, 47, 27, 25, 17, 4, 11, 59, 29, 28, 59, 11, 7, 5, 15, 69, 29, 65, 15, 23, 29, 9, 11, 36, 37, 149
Offset: 1

Views

Author

Art DuPre, Jul 12 2012

Keywords

Comments

This is the first sequence which comes from continued fractions which cannot, so far, be looked at as an apparition sequence for a linearly recursive sequence.
The first term a(1), is always 0. We will always refer to the continued fraction [a,b,c] for short, when we really mean the continued fraction with quotients [a,b,c].
To calculate a(2), we consider [2,2], and take a(2) to be the least number of terms of the sequence 2,3,2,3,... which will have the property that 2[2,2,3,2,3,...,2] = [2^2+k,...,2^2+l], where k,l>=0. We find that 2[2,2,2]=[4,1,4], and both the first term 4 and the last term, 4 are >= 2^2, so 1 is the correct number of terms from 2,3,2,3,.... Thus we have shown that a(2)=1.
Next, to calculate a(3), we consider the sequence [3,2,3,...,3] and notice that if we put only one term from the sequence 2,3,2,3,... between the 3s at the ends, we get 3[3,2,3]=[3^2+1,3,2] and the last term 2 is not >= 3^2, so we consider 3[3,2,3,3]=[3^2+1,3,3,2] and 2 is not >= 3^2, so we look at 3[3,2,3,2,3]=[3^2+1,3,4,4], and 4, the last term, is still not >= 3^2. Next, we consider 3[3,2,3,2,3,3] = [3^2+1,3,4,3,4] and we see that the last term 4 is still not >= 3^2. Finally when we put 5 terms of the sequence 2,3,2,3,.. between, the 3s, we get 3[3,2,3,2,3,2,3] = [10,3,4,3,10], and now the first element 10 is >=3^2, and the last number 10 is also >=3^2, and this proves that a(3)=5. By using the PARI program below, we get the sequence a(n) above, shown in the data portion.

Crossrefs

Programs

  • PARI
    {b23(n)=local(t,m=1,s=[n]); if (n<2,0,while(1,
    if(m%2,s=concat(s,2),s=concat(s,3));
    t=contfracpnqn(concat(s,n));
    t=contfrac(n*t[1,1]/t[2,1]);
    if(t[1]
    				

A213893 Fixed points of a sequence h(n) defined by the minimum number of 4's in the relation n*[n,4,4,...,4,n] = [x,...,x] between simple continued fractions.

Original entry on oeis.org

3, 7, 43, 67, 103, 127, 163, 223, 283, 367, 463, 487, 523, 547, 607, 643, 727, 787, 823, 883, 907, 1063, 1123, 1303, 1327, 1423, 1447, 1543, 1567, 1627, 1663, 1723, 1747, 1783, 1867, 1987, 2083, 2143, 2203, 2287, 2347, 2383, 2467, 2683, 2707, 2767, 2803, 2887
Offset: 1

Views

Author

Art DuPre, Jun 23 2012

Keywords

Comments

In a variant of A213891, multiply n by a number with simple continued fraction [n,4,4,...,4,n] and increase the number of 4's until the continued fraction of the product has the same first and last entry (called x in the NAME). Examples are
2*[2,4,2] = [4,2,4],
3*[3,4,4,4,3] = [9,1,2,2,2,1,9],
4*[4,4,4] = [16,1,16],
5*[5,4,4,4,4,5] = [26,5,1,1,5,26].
The number of 4's needed defines the sequence h(n) = 1, 3, 1, 4, 3, 7, 3, 3, 9, ... (n>=2).
The current sequence contains the fixed points of h, i.e., those n where h(n)=n.
We conjecture that this sequence contains prime numbers analogous to the sequence of prime numbers A000057, in the sense that, instead of referring to the Fibonacci sequences(sequences satisfying f(n) = f(n-1) + f(n-2) with arbitrary positive integer values for f(1) and f(2)) it refers to the sequences satisfying f(n) = 4*f(n-1) + f(n-2), A001076, A001077, A015448, etc. This would mean that a prime is in the sequence if and only if it divides some term in each of the sequences satisfying f(n) = 4*f(n-1) + f(n-2).
The above sequence h() is recorded as A262214. - M. F. Hasler, Sep 15 2015

Crossrefs

Programs

  • Mathematica
    f[m_, n_] := Block[{c, k = 1}, c[x_, y_] := ContinuedFraction[x FromContinuedFraction[Join[{x}, Table[m, {y}], {x}]]]; While[First@ c[n, k] != Last@ c[n, k], k++]; k]; Select[Range[2, 1000], f[4, #] == # &] (* Michael De Vlieger, Sep 16 2015 *)
  • PARI
    {a(n) = local(t, m=1); if( n<2, 0, while( 1,
       t = contfracpnqn( concat([n, vector(m,i,4), n]));
       t = contfrac(n*t[1,1]/t[2,1]);
       if(t[1]
    				

A262213 Minimum number of 3's such that n*[n; 3, ..., 3, n] = [x; ..., x] for some x, where [...] denotes simple continued fractions.

Original entry on oeis.org

2, 1, 5, 2, 5, 7, 5, 5, 2, 3, 5, 12, 23, 5, 11, 7, 5, 19, 5, 7, 11, 21, 5, 14, 38, 17, 23, 6, 5, 31, 23, 3, 23, 23, 5, 18, 59, 25, 5, 6, 23, 41, 11, 5, 65, 47, 11, 55, 14, 7, 77, 25, 17, 11, 23, 19, 20, 11, 5, 29, 95, 23, 47, 38, 11, 67, 23, 21, 23, 71, 5, 36, 56, 29, 59, 7, 77, 25, 11, 53
Offset: 2

Views

Author

M. F. Hasler, Sep 15 2015

Keywords

Comments

Sequence A213892 lists fixed points of this sequence.

Crossrefs

Programs

  • PARI
    cf(v)={t=v[#v];forstep(i=#v-1,1,-1,t=v[i]+1/t);t}
    A262213(n,d=3)=for(k=1,9e9,(c=contfrac(cf(vector(k+2,i,if(i>1&&i
    				

A214018 Least k >= 1, such that prime(n) + k has the form 2^m * q, m >= 0, where q >= 2 is prime.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 1, 3, 2, 1, 1, 2, 1, 1, 3, 3, 4, 2, 1, 2, 3, 3, 1, 3, 2, 3, 2, 1, 1, 1, 5, 3, 2, 3, 1, 1, 2, 3, 1, 1, 2, 3, 3, 2, 3, 3, 5, 5, 2, 1, 1, 2, 1, 3, 4, 2, 1, 3, 1, 7, 2, 3, 3, 3, 1, 3, 3, 1, 5, 1, 3, 3, 2, 1, 2, 3, 4, 3, 3
Offset: 1

Views

Author

Vladimir Shevelev, Jul 01 2012

Keywords

Comments

By the definition, a(n)<=p_(n+1)-p_n. It is well known that, for large n, p_(n+1)-p_n on average is approximately log(n). What is the average behavior of a(n)? By the Broughan-Qizhi inequality, A192869(n)>>n*(log(n))^2. Besides, they conjecture that A192869(n)=O(n*(log(n))^2). But in the case of this sequence, we have, on average, log(n)/2 possible odd values of k< p_(n+1)-p_n.
Therefore, we conjecture that, on average, a(n) is approximately c*log(n) with c in (0,1). Calculations up to 10^6 (Peter J. C. Moses) show that, most likely, c < 0.53 (cf. comment in A213892).

Examples

			a(1)=1, since 2+1=3=2^0*3; a(2)=1, since 3+1=2^1*2.
		

Crossrefs

Programs

  • Mathematica
    Table[NestWhile[#+1&, 1, Not[Apply[Or, PrimeQ[(Prime[n]+#)/(2^Range[0,Floor[Log[Prime[n]]/Log[2]]])]]]&], {n, 100}] (* Peter J. C. Moses, Jul 09 2012 *)
    Table[p = Prime[n]; k = 1; While[q = (p + k)/2^IntegerExponent[p + k, 2]; ! (q == 1 || PrimeQ[q]), k++]; k, {n, 100}] (* T. D. Noe, Jul 10 2012 *)
Showing 1-5 of 5 results.