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.

User: Luis F.B.A. Alexandre

Luis F.B.A. Alexandre's wiki page.

Luis F.B.A. Alexandre has authored 6 sequences.

A300730 Positive integers j of the form Sum_{i=1..k} b(i)c(i), i.e., not in A297345 such that there is only one set {c(1),...,c(k)} where the c(i) are drawn with repetition from {b(0),...,b(k)} and b(k+1) is the smallest element of A297345 that is larger than j, where b() is A297345.

Original entry on oeis.org

3, 5, 6, 8, 10, 12, 13, 17, 19, 20, 22, 27, 32, 34, 36, 37, 41, 43, 44, 46, 61, 67, 68, 82, 84, 91, 95, 107, 119, 126, 129, 131, 153, 167, 204, 211, 214, 252, 261, 416, 452, 489, 499, 537, 6006, 6265, 6266, 6312, 190852, 207403, 208524, 208806, 211967, 213074, 213594, 213677, 214781, 215042, 215075, 215077
Offset: 1

Author

Luis F.B.A. Alexandre, Mar 11 2018

Keywords

Examples

			The first positive integer not in b() is 3. To check if 3 is a(1) we note that the smallest element of b() larger than 3 is b(3)=7, hence k=2. There is only one set of coefficients {c(1),c(2)} that allows 3 to be obtained from Sum_{i=1..k} b(i)c(i). These are c(1)=2 and c(2)=1. So 3 is in fact a(1).
The next integer not in b() is 4. To see if it is a(2) we note that k is still 2 in this case. Now there are two possible sets of coefficients that allow the representation of 4: {0,2} and {2,1}, so 4 is not a term.
		

Crossrefs

Cf. A297345.

Programs

  • Python
    # generates all elements of the sequence, smaller than 6268
    import numpy as np
    import itertools
    def g(i,s,perms):
       c = 0
       for iks in perms:
           t=np.asarray(iks)
           if np.dot(t,s) == i:
               c += 1
           if c == 2:
               break
       if c == 1:
           print(i)
    S=[1, 2, 7,24,85,285,1143]
    S1=[0,1, 2, 7,24,85,285,1143]
    perms = [p for p in itertools.product(S1, repeat=len(S))]
    s=np.asarray(S,dtype=np.int64)
    for i in range(1,6268):
       if i not in S:
           g(i,s,perms)

A298009 a(n) = f(n-1,n)+(n-1)*k, n>=1, where the function f(a,b) gives the number of prime numbers in the range [a*k,b*k[ with k=10^p. For this sequence we use p=2.

Original entry on oeis.org

25, 121, 216, 316, 417, 514, 616, 714, 815, 914, 1016, 1112, 1215, 1311, 1417, 1512, 1615, 1712, 1812, 1913, 2014, 2110, 2215, 2315, 2410, 2511, 2615, 2714, 2812, 2911, 3012, 3110, 3211, 3315, 3411, 3514, 3613, 3712, 3811, 3911, 4015, 4109, 4216, 4309, 4411, 4512, 4612, 4712, 4808, 4915
Offset: 1

Author

Luis F.B.A. Alexandre, Jan 10 2018

Keywords

Comments

Realization of the general term presented in the sequence A298008, for the case of p=2. See detailed comments there.

Crossrefs

Cf. A298008.

Programs

  • Mathematica
    Block[{p = 2, k}, k = 10^p; Array[Apply[Subtract, PrimePi[{k #, k (# - 1)}]] + (# - 1) k &, 50]] (* Michael De Vlieger, Jan 11 2018 *)
  • Python
    # Generates all elements of the sequence smaller than last
    last = 1000
    p=[2]
    c=1
    for i in range(3,last+2,2):
        prime = True
        for j in p:
            if i%j == 0:
                prime=False;
                break
        if prime:
            p.append(i)
            c = c + 1
        ii = (i//100)*100
        if i-ii == 1:
            if prime:
                print(ii-100+c-1, end=',')
                c = 1
            else:
                print(ii-100+c, end=',')
                c = 0

Formula

a(n) = A038822(n-1) + 100*(n-1); - Michel Marcus, Jan 11 2018

A297345 a(0)=0; for n>0, a(n) is the least positive integer that cannot be represented as Sum_{k=1..n-1} a(i_k)*a(k), with 0 <= i_k < n.

Original entry on oeis.org

0, 1, 2, 7, 24, 85, 285, 1143, 6268, 216784, 1059813, 6100794, 226303113
Offset: 0

Author

Luis F.B.A. Alexandre, Dec 28 2017

Keywords

Examples

			a(1)= 1 since it is not possible to write 1 using only a(0). a(2)=2, since it is not possible to obtain 2 using only a(0) and a(1). The following numbers up to 6 can be represented using these first 3 elements of the sequence: 3 = 1*1 + 1*2, 4 = 0*1 + 2*2, 5 = 1*1 + 2*2, 6 = 2*1 + 2*2. Again we reach a number that cannot be represented as defined above, so that number is appended to the sequence. It happens here when we try to represent 7 using only a(0)=0, a(1)=1, and a(2)=2. So 7 becomes a(3).
A larger example: 216752 = 1*1 + 1*2 + 85*7 + 285*24 + 85*85 + 85*285 + 24*1143 + 24*6268
		

Programs

  • Mathematica
    Nest[Function[a, Append[a, 1 + LengthWhile[Differences@ #, # == 1 &] &@ Union[Total /@ Map[a # &, Tuples[a, Length@ a]]]]], {0}, 8] (* Michael De Vlieger, Jan 09 2018 *)
  • Python
    # Generate all the elements in the sequence, S, necessary to represent all
    # numbers until the integer 'last'. It also shows how each integer is
    # represented by showing the sequence elements and the respective
    # multiplicative factors.
    import numpy as np
    import itertools
    last=100
    def generate(i,S):
        n=len(S)
        s=np.asarray(S,dtype=np.int)
        perms = [p for p in itertools.product(S, repeat=n)]
        for iks in perms:
            t=np.asarray(iks)
            if np.dot(t,s) == i:
                print('%d=' %i, end=',')
                print(t,'x',s)
                return 0
        return -1
    S=[0]
    for i in range(1,last+1):
            if generate(i,S) == -1:
                S.append(i)
                generate(i,S)

Extensions

a(9) from Robert G. Wilson v, Jan 09 2018
a(10)-a(11) from Jon E. Schoenfield, Jan 16 2018
a(12) from Giovanni Resta, Jan 22 2018

A298008 a(n) = f(n-1,n) + 10*(n-1), where f(a,b) is the number of primes in the range [10*a,10*b].

Original entry on oeis.org

4, 14, 22, 32, 43, 52, 62, 73, 82, 91, 104, 111, 121, 133, 141, 152, 162, 172, 181, 194, 200, 211, 223, 232, 241, 252, 262, 272, 282, 291, 301, 313, 320, 332, 342, 352, 361, 372, 382, 391, 402, 411, 421, 433, 442, 451, 463, 471, 481, 492, 502, 510, 522, 530, 542, 551, 562, 572, 581, 592, 602, 613, 620, 631, 643
Offset: 1

Author

Luis F.B.A. Alexandre, Jan 10 2018

Keywords

Examples

			The first term has the number of prime numbers between 0 and 9: 4. Since the numbers in this first range are smaller than 10, the left digit would be a zero (not represented). The second term has the number of prime numbers between 10 and 19 (4) and since it was counted in the range between 10 and 19 it represents this range with the one in the first digit in the left: 14. The third element is 22 as there are 2 primes between 20 and 29. And so on. Larger element: there is only one prime between 120 and 129, hence a(13)=121.
		

Crossrefs

Cf. A038800.

Programs

  • Mathematica
    Block[{p = 1, k}, k = 10^p; Array[Apply[Subtract, PrimePi[{k #, k (# - 1)}]] + (# - 1) k &, 67]] (* Michael De Vlieger, Jan 11 2018 *)
  • Python
    # Generates all elements of the sequence smaller than 'last'
    last = 1000
    p=[2]
    c=1
    for i in range(3,last+2,2):
        prime = True
        for j in p:
            if i%j == 0:
                prime=False;
                break;
        if prime:
            p.append(i)
            c = c + 1
        ii = (i//10)*10
        if i-ii == 1:
            if prime:
                print(ii-10+c-1, end=',')
                c = 1
            else:
                print(ii-10+c, end=',')
                c = 0

Formula

a(n) = A038800(n-1) + 10*(n-1). - Michel Marcus, Jan 11 2018

Extensions

Edited by N. J. A. Sloane, Jan 28 2018

A173042 Numbers n that cannot be decomposed into the sum of up to 4 squares using the following algorithm: If n is not decomposable using the algorithm: [Repeat the following 2 steps 4 times: 1-find the largest square s smaller than n; 2-n=n-s Numbers that can be decomposed yield final values of n=0.] then choose the first square as the second largest square smaller than n and try finding the remaining up to 3 squares using the 2 steps of the algorithm in brackets.

Original entry on oeis.org

48, 71, 96, 112, 128, 143, 163, 176, 191, 192, 208, 211, 224, 244, 248, 268, 288, 304, 308, 311, 312, 317, 331, 336, 352, 356, 376, 380, 384, 422, 428, 431, 432, 439, 448, 456, 460, 463, 496, 512, 516, 536, 544, 551, 560, 568, 571, 572, 599, 604, 607, 608
Offset: 1

Author

Luis F.B.A. Alexandre (lfbaa(AT)di.ubi.pt), Feb 08 2010

Keywords

Comments

This is a subsequence of A112687.

Examples

			For n=48: it is not decomposable using the algorithm in brackets, so instead of using the first s=36 we choose s=25 (the second largest). So the attempt to decompose 48 is now 5*5+(up to more 3 squares which will be found using steps 1 and 2 of the algorithm in brackets). This yields 5*5+4*4+2*2+1*1 which does not give 48 hence it is not decomposable using this algorithm.
		

Crossrefs

A112687 Numbers n that cannot be decomposed into the sum of at most 4 square numbers when using the following algorithm: Repeat the following 2 steps 4 times: 1-find the largest square s smaller than n; 2-n=n-s Numbers that can be decomposed yield final values of n=0. The sequence presented is of those numbers where n is not 0 when this algorithm ends.

Original entry on oeis.org

23, 32, 43, 48, 56, 61, 71, 76, 79, 88, 93, 96, 107, 112, 115, 119, 128, 133, 136, 140, 143, 151, 156, 159, 163, 166, 167, 176, 181, 184, 188, 191, 192, 203, 208, 211, 215, 218, 219, 224, 232, 237, 240, 244, 247, 248, 253, 263, 268, 271, 275, 278, 279, 284
Offset: 1

Author

Luis F.B.A. Alexandre (lfbaa(AT)di.ubi.pt), Dec 31 2005

Keywords

Comments

Found while writing a program to decompose integers as sums of four square numbers (following Lagrange's Four-Square Theorem).
Question: does the sum of the reciprocals of the numbers in this sequence converge? - J. Lowell, May 03 2014
Answer: this series is divergent. - Thomas Ordowski, May 22 2016
Numbers n such that A053610(n) > 4. - Thomas Ordowski, May 22 2016

Examples

			23 is the first number that cannot be decomposed because 16+4+1+1 falls short by one.
		

Programs

  • MATLAB
    for n=1:312 a=n; i=1; while(i<5 & n~=0) j=1; while(j*j<=n) j=j+1; end; n=n-(j-1)*(j-1); i=i+1; end; if(n~=0) disp(a); end; end; % Luis F.B.A. Alexandre (lfbaa(AT)di.ubi.pt), Feb 08 2010
  • Mathematica
    f1[x_]:=Floor[Sqrt[x]];
    f2[x_]:=Floor[Sqrt[x-f1[x]^2]];
    f3[x_]:=Floor[Sqrt[x-f1[x]^2-f2[x]^2]];
    f4[x_]:=Floor[Sqrt[x-f1[x]^2-f2[x]^2-f3[x]^2]];
    Err[n_]:=n-(f1[n]^2+f2[n]^2+f3[n]^2+f4[n]^2);
    Select[Table[n,{n,0,5000}],Err[#]!=0&] (* Enrique Pérez Herrero, Dec 19 2013 *)

Extensions

Included terms where the final value of n is larger than 1. The fact that some terms might be missing was noted by Alonso del Arte on 2010-02-07. Luis F.B.A. Alexandre (lfbaa(AT)di.ubi.pt), Feb 08 2010