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.

A126257 Number of distinct new terms in row n of Pascal's triangle.

Original entry on oeis.org

1, 0, 1, 1, 2, 2, 2, 3, 4, 4, 4, 5, 6, 6, 7, 5, 7, 8, 9, 9, 9, 8, 11, 11, 12, 12, 13, 13, 13, 14, 15, 15, 16, 16, 17, 16, 17, 18, 19, 19, 20, 20, 21, 21, 22, 21, 23, 23, 24, 24, 25, 25, 26, 26, 27, 26, 26, 28, 29, 29, 30, 30, 31, 31, 32, 32, 32, 33, 34, 34, 34, 35, 36, 36, 37, 37, 38
Offset: 0

Views

Author

Nick Hobson, Dec 24 2006

Keywords

Comments

Partial sums are in A126256.
n occurs a(n) times in A265912. - Reinhard Zumkeller, Dec 18 2015

Examples

			Row 6 of Pascal's triangle is: 1, 6, 15, 20, 15, 6, 1. Of these terms, only 15 and 20 do not appear in rows 0-5. Hence a(6)=2.
		

Crossrefs

Programs

  • Haskell
    import Data.List.Ordered (minus, union)
    a126257 n = a126257_list !! n
    a126257_list = f [] a034868_tabf where
       f zs (xs:xss) = (length ys) : f (ys `union` zs) xss
                       where ys = xs `minus` zs
    -- Reinhard Zumkeller, Dec 18 2015
    
  • PARI
    lim=77; z=listcreate(1+lim^2\4); print1(1, ", "); r=1; for(a=1, lim, for(b=1, a\2, s=Str(binomial(a, b)); f=setsearch(z, s, 1); if(f, listinsert(z, s, f))); print1(1+#z-r, ", "); r=1+#z)
    
  • Python
    def A126257(n):
        if n:
            s, c = (1,), {1}
            for i in range(n-1):
                c.update(set(s:=(1,)+tuple(s[j]+s[j+1] for j in range(len(s)-1))+(1,)))
            return len(set((1,)+tuple(s[j]+s[j+1] for j in range(len(s)-1))+(1,))-c)
        return 1 # Chai Wah Wu, Oct 17 2023

A126254 Number of distinct terms i^j for 1 <= i,j <= n.

Original entry on oeis.org

1, 3, 7, 11, 19, 28, 40, 50, 60, 76, 96, 115, 139, 163, 189, 207, 239, 270, 306, 340, 378, 417, 461, 503, 539, 585, 621, 670, 726, 779, 839, 881, 941, 1003, 1067, 1113, 1185, 1254, 1326, 1397, 1477, 1553, 1637, 1717, 1799, 1884, 1976, 2063, 2135, 2225
Offset: 1

Views

Author

Nick Hobson, Dec 24 2006

Keywords

Comments

An easy upper bound is n(n-1)+1 = A002061(n).

Examples

			a(4) = 11, as there are 11 distinct terms in 1^1=1, 1^2=1, 1^3=1, 1^4=1, 2^1=2, 2^2=4, 2^3=8, 2^4=16, 3^1=3, 3^2=9, 3^3=27, 3^4=81, 4^1=4, 4^2=16, 4^3=64, 4^4=256.
		

Crossrefs

Programs

  • Maple
    seq(nops({seq(seq(i^j, i=1..n),j=1..n)}),n=1..100); # Robert Israel, Feb 23 2015
  • PARI
    lim=50; z=listcreate(lim*(lim-1)+1); for(m=1, lim, for(i=1, m, x=factor(i); x[, 2]*=m; s=Str(x); f=setsearch(z, s, 1); if(f, listinsert(z, s, f))); t=factor(m); for(j=1, m, x=t; x[, 2]=j*t[, 2]; s=Str(x); f=setsearch(z, s, 1); if(f, listinsert(z, s, f))); print1(#z, ", "))
    
  • Python
    def A126254(n): return len({i**j for i in range(1,n+1) for j in range(1,n+1)}) # Chai Wah Wu, Oct 17 2023
  • R
    A126254 <- function(limit) {  if (limit == 1) { return(1) } ; num.powers <- c(1, rep(0, limit-1)) ; handled <- c(T, rep(F, limit-1)) ; for (base in 2:ceiling(sqrt(limit))) { if (!handled[base]) { num.handle <- floor(log(limit, base)) ; handled[base^(1:num.handle)] <- T ; num.powers[base] <- length(unique(as.vector(outer(1:num.handle, 1:limit)))) }} ; num.powers[!handled] <- limit ; sum(num.powers) } ; A126254(50) # John Silberholz, Feb 23 2015
    

A126255 Number of distinct terms i^j for 2 <= i,j <= n.

Original entry on oeis.org

1, 4, 8, 15, 23, 34, 44, 54, 69, 88, 106, 129, 152, 177, 195, 226, 256, 291, 324, 361, 399, 442, 483, 519, 564, 600, 648, 703, 755, 814, 856, 915, 976, 1039, 1085, 1156, 1224, 1295, 1365, 1444, 1519, 1602, 1681, 1762, 1846, 1937, 2023, 2095, 2184, 2279
Offset: 2

Views

Author

Nick Hobson, Dec 24 2006

Keywords

Comments

An easy upper bound is (n-1)^2 = A000290(n-1).

Examples

			a(4) = 8 as there are 8 distinct terms in 2^2=4, 2^3=8, 2^4=16, 3^2=9, 3^3=27, 3^4=81, 4^2=16, 4^3=64, 4^4=256.
		

Crossrefs

Programs

  • Mathematica
    SetAttributes[a, {Listable, NumericFunction}]
    a[n_ /; n < 2] := "error"
    a[2] := 1
    a[n_Integer?IntegerQ /; n > 2] :=
     Length[DeleteDuplicates[
       Distribute[f[Range[2, n], Range[2, n]], List,
         f] /. {f ->
          Power}]](*By using Distribute instead of Outer I avoid having to use Flatten on Outer*)
    a[Range[2, 100]]
    (* Peter Cullen Burbery, Aug 15 2023 *)
  • PARI
    lim=51; z=listcreate((lim-1)^2); for(m=2, lim, for(i=2, m, x=factor(i); x[, 2]*=m; s=Str(x); f=setsearch(z, s, 1); if(f, listinsert(z, s, f))); t=factor(m); for(j=2, m, x=t; x[, 2]=j*t[, 2]; s=Str(x); f=setsearch(z, s, 1); if(f, listinsert(z, s, f))); print1(#z, ", "))
    
  • Python
    def A126255(n): return len({i**j for i in range(2,n+1) for j in range(2,n+1)}) # Chai Wah Wu, Oct 17 2023

A199425 Number of distinct primes in rows 0 through n of the triangle in A199333.

Original entry on oeis.org

0, 0, 1, 2, 4, 5, 8, 10, 13, 17, 20, 24, 30, 35, 42, 49, 57, 63, 71, 80, 90, 99, 110, 121, 133, 145, 157, 170, 184, 197, 212, 227, 242, 258, 275, 292, 310, 327, 345, 364, 384, 404, 425, 446, 467, 489, 512, 535, 558, 581, 606, 630, 656, 682, 709, 736, 764
Offset: 0

Views

Author

Reinhard Zumkeller, Nov 09 2011

Keywords

Crossrefs

Programs

  • Haskell
    import Data.List (union)
    a199425 n = a199425_list !! n
    a199425_list = f [] a199333_tabl where
       f ps (ts:tts) =  (length ps') : f ps' tts where
         ps' = ps `union` (take ((length ts - 1) `div` 2) $ tail ts)

A258318 Number of distinct numbers in rows 0 through n of triangle A258197.

Original entry on oeis.org

1, 1, 2, 2, 4, 5, 7, 9, 12, 16, 20, 24, 29, 34, 41, 44, 50, 57, 66, 74, 83, 91, 102, 112, 124, 135, 148, 161, 174, 187, 201, 214, 230, 246, 263, 279, 296, 313, 331, 349, 369, 388, 408, 428, 450, 471, 494, 516, 540, 563, 588, 612, 637, 662, 689, 715, 741, 769
Offset: 0

Views

Author

Reinhard Zumkeller, May 26 2015

Keywords

Crossrefs

Programs

  • Haskell
    import Data.Set (singleton, insert, size)
    a258318 n = a258318_list !! n
    a258318_list = f 2 a258197_tabl $ singleton 0 where
       f k (xs:xss) zs = g (take (div k 2) xs) zs where
         g []     ys = size ys : f (k + 1) xss ys
         g (x:xs) ys = g xs (insert x ys)
Showing 1-5 of 5 results.