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

A034706 Numbers which are sums of consecutive triangular numbers.

Original entry on oeis.org

0, 1, 3, 4, 6, 9, 10, 15, 16, 19, 20, 21, 25, 28, 31, 34, 35, 36, 45, 46, 49, 52, 55, 56, 64, 66, 74, 78, 80, 81, 83, 84, 85, 91, 100, 105, 109, 110, 116, 119, 120, 121, 130, 136, 144, 145, 153, 155, 161, 164, 165, 166, 169, 171, 185, 190, 196, 199, 200, 202, 210
Offset: 1

Views

Author

Keywords

Crossrefs

Complement gives A050941.
Cf. A000217 (1 consec), A001110 (2 consec), A129803 (3 consec), A131557 (5 consec), A257711 (7 consec), A034705, A269414 (subsequence of primes).

Programs

  • Haskell
    -- import Data.Set (deleteFindMin, union, fromList); import Data.List (inits)
    a034706 n = a034706_list !! (n-1)
    a034706_list = f 0 (tail $ inits $ a000217_list) (fromList [0]) where
       f x vss'@(vs:vss) s
         | y < x = y : f x vss' s'
         | otherwise = f w vss (union s $ fromList $ scanl1 (+) ws)
         where ws@(w:_) = reverse vs
               (y, s') = deleteFindMin s
    -- Reinhard Zumkeller, May 12 2015
  • Maple
    isA034706 := proc(n)
        local a,b;
        for a from 0 do
            if a*(a+1)/2 > n then
                return false;
            end if;
            for b from a do
                tab := (1+b-a)*(a^2+b*a+a+b^2+2*b)/6 ;
                if tab = n then
                    return true;
                elif tab > n then
                    break;
                end if;
            end do:
        end do:
    end proc:
    for n from 0 to 100 do
        if isA034706(n) then
            printf("%d,",n) ;
        end if;
    end do: # R. J. Mathar, Dec 14 2015
  • Mathematica
    M = 1000; (* to get all terms <= M *)
    nmax = (Sqrt[8 M + 1] - 1)/2 // Ceiling;
    Table[Sum[n(n+1)/2, {n, j, k}], {j, 0, nmax}, {k, j, nmax}] // Flatten // Union // Select[#, # <= M&]& (* Jean-François Alcover, Mar 10 2019 *)

A257974 Prime numbers that are not the sum of one or more consecutive triangular numbers.

Original entry on oeis.org

2, 5, 7, 11, 13, 17, 23, 29, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 89, 97, 101, 103, 107, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 211, 223, 227, 229, 233, 239, 241, 257, 263, 269, 271, 277, 281, 283
Offset: 1

Views

Author

Keywords

Comments

Subsequence of primes of A050941. - Michel Marcus, Dec 14 2015
Prime numbers that are not the difference of two tetrahedral numbers (A000292). - Franklin T. Adams-Watters, Dec 16 2015

Examples

			From _Michael De Vlieger_, Nov 06 2015: (Start)
3 is a triangular number thus is not a term.
The triangular numbers <= 7 are {1, 3, 6}. None of these are 7. 7 is not found among the sums of adjacent pairs of terms, i.e., {{1, 3}, {3, 6}} = {4, 9}. The sum of all numbers {1, 3, 6} = 10. Thus 7 is a term.
The triangular numbers <= 19 are {1, 3, 6, 10, 15}. 19 is not a triangular number. 19 is not found among sums of pairs of adjacent terms {4, 9, 16, 25} nor among those of quartets of adjacent terms {20, 34}, but is found among sums of triples of adjacent terms {10, 19, 31}. Thus 19 is not a term. (End)
		

Crossrefs

Programs

  • Maple
    isA257974 := proc(n)
        if isprime(n) then
            return not isA034706(n) ;
        else
            false ;
        end if;
    end proc:
    for n from 0 to 400 do
        if isA257974(n) then
            printf("%d,",n) ;
        end if;
    end do: # R. J. Mathar, Dec 14 2015
  • Mathematica
    t = Array[Binomial[# + 1, 2] &, {10^4}]; fQ[n_] := Block[{s}, s = TakeWhile[t, # <= n &]; AnyTrue[Flatten[Total /@ Partition[s, #, 1] & /@ Range[Length@ s - 1]], # == n &]]; Select[Prime@ Range@ 120, ! fQ@ # &] (* Michael De Vlieger, Nov 06 2015, Version 10 *)

Extensions

More terms from Michael De Vlieger, Nov 06 2015

A307493 Primes that are both centered triangular and centered square.

Original entry on oeis.org

16381, 23199907725541, 873105326726527441, 169377932722437899461, 532026300937919058017204151243671297356368598920355705257429996547710782877327451810988538831181
Offset: 1

Views

Author

Ilya Gutkovskiy, Apr 10 2019

Keywords

Comments

Primes that are the sum of three consecutive triangular numbers and the sum of two consecutive squares.
The next term is too large to include.

Crossrefs

Programs

  • Mathematica
    Select[LinearRecurrence[{195, -195, 1}, {1, 85, 16381}, 43], PrimeQ[#] &]
Showing 1-3 of 3 results.